This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Why don't this work?
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Why don't this work?
- From: Jonathan Marsh <jmarsh at microsoft dot com>
- Date: Thu, 6 Apr 2000 09:58:17 -0700
- Reply-To: xsl-list at mulberrytech dot com
nodeName() is not a node selector, and cannot be used outside a filter [].
In XSLT, the equivalent function name() can be used in certain places like
value-of select="" but still not in apply-templates or match. A node's name
is a property of the node, not a node itself.
- Jonathan Marsh
Microsoft
> -----Original Message-----
> From: Westerlund, Malin [mailto:malin.westerlund@framfab.se]
> Sent: Thursday, April 06, 2000 4:33 AM
> To: 'xsl-list@mulberrytech.com'
> Subject: Why don't this work?
>
>
> I'm trying to get the tagname, but it doesn't seem to work.
> I'm not so good
> at this so I might have done something very wrong. The
> node() works but not
> the nodeName().
>
>
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"
> xmlns="http://www.w3.org/TR/REC-html40">
>
> <xsl:template match="/">
> <TABLE>
> <TR>
> <xsl:for-each select="*/element()">
> <TD>
> <xsl:apply-templates select="./nodeName()"/>
> </TD>
> </xsl:for-each>
> </TR>
> <xsl:for-each select="*/element()">
> <TR>
> <TD>
> <xsl:apply-templates select="./node()"/>
> </TD>
> </TR>
> </xsl:for-each>
> </TABLE>
> </xsl:template>
>
> <xsl:template match="./nodeName()">
> <xsl:value-of /><td/>
> </xsl:template>
>
> <xsl:template match="./node()">
> <xsl:value-of /><td/>
> </xsl:template>
>
> </xsl:stylesheet>
>
> I'm using msxml3
>
> regards
>
> Malin
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list