xsl-list
[Top] [All Lists]

[xsl] Trouble understanding the Test expression in xsl:if

2009-05-27 15:28:33
I'm having trouble getting my head around this:

My shortened XML data:

<category>
        <category_name>apples</category_name>
        <product>red delicious</product>
</category>
        <category_name>oranges</category_name>
        <product>sunkist</product>
</category>

My simplified XSLT:

<xsl:template match="category">
        <xsl:apply=templates/>
</xsl:template>

<xsl:template match="category_name">
        <xsl:if test="category_name = apples">
                <xsl:call-template name=apple_template/>
        </xsl:if>
</xsl:template>


For the life of me I can't figure out how to evaluate the value of "category_name" in the xsl:if line. I understand (I think) how to use xsl:value-of, but that doesn't seem to work inside the xsl:if. Any thoughts?

~ Keith







--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>