EclipseLink MOXy @XmlPath support for axes / parent

Are any of the following XPath expressions acceptable? Using version 2.3.1 eclipselink

@XmlPath("../header/@type") @XmlPath("/root/header/@type") @XmlPath("parent::*/header/@type") 

This is mainly in a class that repeats inside an XML document ( /root/tag ), if this is not clear, I will tell.

I'm trying to cross a tree, not down. My other @XmlPath annotations work fine.

+6
source share
1 answer

EclipseLink JAXB (MOXy) does not currently support the axis / parent. If you are interested in such support, please enter a promotion request:

It supports XPath like:

  • @XmlPath (".") // Map to self node, useful when matching two objects with the same element
  • @XmlPath ("@foo") // Map for attribute
  • @XmlPath ("foo") // Map for the item
  • @XmlPath ("foo [2]") // Map for the second appearance
  • @XmlPath ("foo [@bar = 'Hello World']") // Map for the foo element with the bar attribute with the value "Hello World"
  • @XmlPath ("ns1: foo / ns2: @bar") // Map to namespace qualified nodes

Additional Information

+1
source

Source: https://habr.com/ru/post/903213/


All Articles