This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Getting Attribute names in an XML with XSLT stylesheet



thanks. this works.
--Morgan

>From: Jeni Tennison <jeni@jenitennison.com>
>Reply-To: xsl-list@lists.mulberrytech.com
>To: "Morgan Nagarajan" <takkals@hotmail.com>
>CC: XSL-List@lists.mulberrytech.com
>Subject: Re: [xsl] Getting Attribute names in an XML with XSLT stylesheet
>Date: Mon, 8 Apr 2002 09:53:58 +0100
>
>Hi Morgan,
>
> > Is there any provisions to explicitly display the attribute name of
> > an XML element. It's easy to get an attribute value (knowing or w/o
> > knowing attribute name) but I could not find any easy way to get the
> > name of an attribute (FYI, I don't know attribute name existing in a
> > XML element, beforehand)
>
>You can get the name of any node (including attributes) using the
>name() function. Pass the node as the argument to the name() function,
>or don't pass any arguments if you want to use the context node:
>
><xsl:template match="@*">
>   <xsl:value-of select="name()"/>
></xsl:template>
>
>Cheers,
>
>Jeni
>
>---
>Jeni Tennison
>http://www.jenitennison.com/
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]