This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: XSLT: Does an element know about its type?
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: XSLT: Does an element know about its type?
- From: Mike Brown <mbrown at corp dot webb dot net>
- Date: Sat, 4 Mar 2000 16:59:20 -0700
- Cc: "'may at informatik dot uni-freiburg dot de'" <may at informatik dot uni-freiburg dot de>
- Reply-To: xsl-list at mulberrytech dot com
> <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