I have an xml document that I am trying to style with xsl. The problem is depending on the value I need to pull from a certain node, but in xsl I do not know how to distinguish between the two following nodes:
XML:
<a number=1>
<car>1</car>
</a>
<a number=2>
<dog>1</dog>
</a>
<I_want_to_display>
<number>2</number>
</I_want_to_display>
XSL:
<xsl:for-eachselect="I_want_to_display">
<xsl:if test="number==2">
....display everything in <a number=2>
</xsl:if>
Without knowing exactly what output you’re looking for, but here’s a guess.
This well-formed XML input:
with this stylesheet:
produces this output: