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

how can I test current element type?

Subject: how can I test current element type?
From: Dave Carlson <dcarlson@xxxxxxxxxxxxxx>
Date: Tue, 25 Aug 1998 10:34:49 -0600
how to test current
I'd like to test the *current* element type within an <xsl:if /> statement,
but this does not seem possible in the current XSL pattern syntax. In the
following extract, I tried the statement:
        <xsl:if test=".[Interface]">interface </xsl:if>
But, this is rejected by the XT processor.  I intend for this to say "is the
current element of type 'Instance'?"  Should this be accepted? Is there an
alternative?

  <xsl:template match="Package">
    <xsl:process select="ownedElement/Interface"/>
    <xsl:process select="ownedElement/Class"/>
  </xsl:template>

  <xsl:template match="Interface|Class">
    <DIV style="color: black; padding: 6px; font-size: 12pt; font-weight: bold">
      <xsl:process select="visibility"/><xsl:text> </xsl:text>
      <xsl:process select="isLeaf"/><xsl:text> </xsl:text>
      <xsl:process select="isAbstract"/><xsl:text> </xsl:text>
      <xsl:process select="ownerScope"/><xsl:text> </xsl:text>
      <xsl:if test=".[Interface]">interface </xsl:if>
      <xsl:if test=".[Class]">class </xsl:if>
      <xsl:process select="name"/><xsl:text> </xsl:text>
      <xsl:process select="generalization"/>
    </DIV>
    ... more stuff
  </xsl:template>


 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.