问题
Can any one please let me know how can I access an array of elements to a property.
For example: I have an XML as said below
<a>
<x>1</x>
<x>2</x>
<x>3</x>
<x>4</x>
</a>
I want my property to be set as shown below:
<x>1</x>
<x>2</x>
<x>3</x>
<x>4</x>
when I try to access using //x with property type set to OM element or String I don't see the result as expected in my property.
Can any one please direct me with the right xpath to be used to see the desired outcome ?
回答1:
You should be able to use //a/child::node() XPath for this.
Please refer XPath to get all child nodes (elements, comments, and text) without parent
Hope this helps!!
/Harshana
来源:https://stackoverflow.com/questions/12732541/how-to-catch-an-array-of-nodes-to-a-property