I am looking for an XPath 1.0 statement. I cannot use XSLT.
XML Example
<root>
<data>
<okay>Hello</okay>
</data>
<data>
<okay>World</okay>
</data>
</root>
I need to extract the last data contents retaining the xml structure. Results should look like the following
<root>
<data>
<okay>World</okay>
</data>
</root>
Unfortunately, I cannot search on values in okay
element because it is dynamic.
I tried the following, but it returns everything:
/root[data[last()]]