hi!
I am new to XPath, and from what I have read in some tutorials about axes, I am still left wondering how to implement them. They aren't quite behaving as I had expected. I am particularly interested in using ancestor and descendant axes.
I have the following XML structure:
<file>
<criteria>
<root>ROOT</root>
<criterion>AAA</criterion>
<criterion>BBB</criterion>
<criterion>CCC</criterion>
</criteria>
<format>
<sort>BBB</sort>
</format>
</file>
And I have the following XSL:
<xsl:template match="/">
<xsl:copy-of select="ancestor::criterion/>
</xsl:template>
which produces nothing!
I expected it to produce:
<file>
<criteria>
</criteria>
</file>
Can someone explain ancestor and descendant axes to me in a more helpful way than the tutorials I have previously read?
Thanks!