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

<xsl:choose>'ing from different forms of a tag

Subject: <xsl:choose>'ing from different forms of a tag
From: <xml@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 17 Jul 2002 12:25:08 -0500 (CDT)
ing from
Hi,

I have an XSD file that uses a xsd:union to allow the tag <term> to have
one of three different sequences.  In particular, <term> can be of any
of the following:

(1)     <term>
                <term>...</term>
                <_literal_>*</_literal_>
                <factor>...</factor>
        </term>


(2)     <term>
                <term>...</term>
                <_literal_>/</_literal>
                <factor>...</factor>
        </term>


(3)     <term>
                <factor>...</factor>
        </term>



My question is: when I write a templat for <term>, can I match against
the different sequences?  For example, I would like to write a
transform like:

        <xsl:template match="term">
        <xsl:choose>

                <xsl:when test="[ somehow test for form (1) ]">
                        (do stuff)
                </xsl:when>


                <xsl:when test="[ somehow test for form (2) ]">
                        (do different stuff)
                </xsl:when>


                <xsl:when test="[ somehow test for form (3) ]">
                        (do completely different stuff)
                </xsl:when>


                <xsl:otherwise>
                        (never get here, no other forms are allowed)
                </xsl:otherwise>

        </xsl:choose>
        </xsl:template>

I don't know what to put in the test="..." areas though.  Any ideas?

Thanks,

        Jared



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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-2013 All Rights Reserved.