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

Re: [XSLT/newbie]value-of attributes of the root node

Subject: Re: [XSLT/newbie]value-of attributes of the root node
From: "John E. Simpson" <simpson@xxxxxxxxxxx>
Date: Tue, 19 Sep 2000 12:02:01 -0400
xslt value of attribute
At 02:25 PM 09/19/2000 +0000, nik.makepeace@xxxxxxxxxxxx wrote:
The source is:
<description name="AirCon 5000">
 <change recency="7">
 text
 </change>
 <change recency="4">
 text
 </change>
 <change recency="3">
 text
 </change>
</description>

but this template returns nothing between <name> and </name>:

<xsl:template match="/">
 <outputroot>
  <name><xsl:value-of select="@name" />
  </name>
 <xsl:apply-templates />
 </outputroot>
</xsl:template>

The template matches on the document root node, not on the document root *element* node. So the xsl:value of selects on the attribute of the root node, which of course has no attributes.


Try changing the match pattern to match="/description".

==========================================================
John E. Simpson | "If you were going to
http://www.flixml.org | shoot a mime, would you use
XML Q&A: http://www.xml.com | a silencer?" (Steven Wright)



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.