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

Re: Getting Attribute names in an XML with XSLT styles

Subject: Re: Getting Attribute names in an XML with XSLT stylesheet
From: "Morgan Nagarajan" <takkals@xxxxxxxxxxx>
Date: Mon, 08 Apr 2002 12:09:30 -0400
xslt styles

thanks. this works. --Morgan

From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: "Morgan Nagarajan" <takkals@xxxxxxxxxxx>
CC: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  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



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.