I want to match two expression using OR statement in xsl:apply-templates select.i want to check following conditions...
<xsl:apply-templates select="//w:body/w:p[w:r[w:t]] or //w:body/w:p[w:r[w:pict]]">
// My Functionality
</xsl:apply-templates>
But i dont know how i do this. Please Guide me to get out of this issue...
You can use
or
, and it's really correct to use it in this context because you don't want the testing nodes:|
(union) is indispensabile only if you need to select the testing nodes (w:t
andw:pict
):where XPath 2.0 allows you to write more concisely:
I don't know about XSLT 2.0, but in XSLT 1.0
<xsl:apply-templates select="//w:body/w:p[w:r[w:t]] or //w:body/w:p[w:r[w:pict]]">
isn't valid query. Use|
instead ofor
.