B
bjam
Hi, a quick basic question here on XPATH
if I have the following data
<X>
<X1>TEST</X1>
<Z>
<Z1>Item 1</Z1>
<Z2>Item 2</Z2>
<Z3>Item 3</Z3>
</Z>
</X>
<X>
<X1>TEST2</X1>
<Z>
<Z1> ... </Z1>
<Z2> ... etc.
</Z>
</X>
will the following XPATH statement be valid in a template match
statement? My experience has been no, and I have had to get the root
node X and then do an if on X1 before processing. See below for the
statement. Any ideas on how to get this to work in a single XPATH
statement?
<xsl:template match="/X/X1[starts-with(text(),'TEST2']/Z">
<!-- assumption here is that I get the <Z> node to process -->
<!-- however I am thinking that the predicate has to be the last
statement in an XPATH statement, is this true?-->
if I have the following data
<X>
<X1>TEST</X1>
<Z>
<Z1>Item 1</Z1>
<Z2>Item 2</Z2>
<Z3>Item 3</Z3>
</Z>
</X>
<X>
<X1>TEST2</X1>
<Z>
<Z1> ... </Z1>
<Z2> ... etc.
</Z>
</X>
will the following XPATH statement be valid in a template match
statement? My experience has been no, and I have had to get the root
node X and then do an if on X1 before processing. See below for the
statement. Any ideas on how to get this to work in a single XPATH
statement?
<xsl:template match="/X/X1[starts-with(text(),'TEST2']/Z">
<!-- assumption here is that I get the <Z> node to process -->
<!-- however I am thinking that the predicate has to be the last
statement in an XPATH statement, is this true?-->