Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

In this example, we want to address all items of a purchaseOrder.

The XPath expression reads as follows:
/purchaseOrder/item

To address the JAXFront list type item, the XPath expression reads as follows:
/purchaseOrder/item[list]

To address individual items, apply the following completely normal XPath expression:
/purchaseOrder/item[3].

The [text] predicate identifies the contents of a leaf element, which has at least one attribute defined. This leaf element becomes a simple group for JAXFront (see Representation Types in the JAXFront Whitepaper).
However, with the normal XPath expression, you cannot differentiate what is meant: the whole group or only the text contents of this node.

  • /../NodeB identifies a SimpleGroup named NodeB
  • /../NodeB[text] identifies a SimpleType, the text contents of NodeB
  • /../NodeB/@A identifies a SimpleType, the attribute A of the NodeB