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

RE: XSLT: Does an element know about its type?

Subject: RE: XSLT: Does an element know about its type?
From: Mike Brown <mbrown@xxxxxxxxxxxxx>
Date: Sat, 4 Mar 2000 16:59:20 -0700
what does an element do
> <xsl:template match="river|lake|sea|island|mountain|desert">
>   < this tag should be the element's tag, i.e, river or lake or ... >
>     <xsl:copy-of select=" ... several properties ..."/>
>     ... some more things ...
>   </ suitable close-tag >
> </xsl:template>

The name() function will tell you the element type, but
for what you want to do, the xsl:copy instruction is more
appropriate. Either of these will do the trick:

<xsl:template match="river|lake|sea|island|mountain|desert">
  <xsl:copy>
    <!-- element attributes and contents go here -->
  </xsl:copy>
</xsl:template>

<xsl:template match="river|lake|sea|island|mountain|desert">
  <xsl:element name="name()">
    <!-- element attributes and contents go here -->
  </xsl:element>
</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.