|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: is this a limitation / processor bug?
<xsl:template match="schematics">
<xsl:variable name="model" select="modelnumber"/>
<xsl:variable name="applicableModel" select="documentation/currentModel"/>
<xsl:choose>
<xsl:when test="$model=$applicableModel">
<xsl:apply-templates select="link"/>
</xsl:when>
</xsl:choose>
</xsl:template>
(I removed two / and changed one \ to / from your original)
This may or may not be correct, depending on what your input looks like.
If it is correct, you don't need the variables, it is equivalent to
<xsl:template match="schematics">
<xsl:choose>
<xsl:when test="modelnumber="documentation/currentModel">
<xsl:apply-templates select="link"/>
</xsl:when>
</xsl:choose>
</xsl:template>
so your input looks like this?
<schematics>
<documentation>
<currentModel>123</currentModel>
</documentation>
<modelnumber>123</modelnumber>
<link>
stuff that has templates applied
</link>
<schematics>
If so, your template looks about right except beware you are doing
string comparison in that = so any white space differences would
make it false, you may want number(modelnumber)=number(documentation/currentModel)
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








