[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] how can I test current element type?
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
|
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
|