[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Choosing based on current node

Subject: Choosing based on current node
From: <sthomas2@xxxxxxx>
Date: Mon, 12 Feb 2007 11:07:01 -0500
 Choosing based on current node
I'm amazed at how patient this list is with newbie questions; I hope
this question doesn't try that patience too much. I'm processing a
document that has <A> or <B> or <C> elements in it. I need to preserve
their order in the output, but do something drastically different for
each. It seems like the following ought to work, but, instead, the
otherwise branch is always performed, regardless of whether the element
is A, B, or C. (The for-each is working fine, as it correctly skips over
any elements other than A, B, or C.)

<xsl:for-each select="A|B|C">
    <xsl:choose>
        <xsl:when test=".=A">
            <xsl:call-template name="do-A"/>
        </xsl:when>
        <xsl:when test=".=B">
            <xsl:call-template name="do-B"/>
        </xsl:when>
        <xsl:otherwise>
            <xsl:call-template name="do-C"/>
        </xsl:otherwise>
    </xsl:choose>
</xsl:for-each>

Thanks in advance,

Stephen

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.