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

RE: sorting by attribute + element vs attribute

Subject: RE: sorting by attribute + element vs attribute
From: "Pawson, David" <DPawson@xxxxxxxxxxx>
Date: Mon, 28 Feb 2000 08:18:18 -0000
xml attribute vs element
Steve Muench 

>How about:
>
><wrapper xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
>xsl:version="1.0">
>  <xsl:for-each select="sender/a">
>    <xsl:sort select="@clli"/>
>    <a><xsl:value-of select="@clli"/></a>
>    <b><xsl:value-of select="@b"/></b>
>  </xsl:for-each>
></wrapper>
>  
>This produces:
>
><wrapper><a>100</a><b>10</b><a>200</a><b>20</b></wrapper>

Thanks Steve.

I knew the current context changed within for-each,
I made the wrong assumption that is also changed
(to the attribute) within the sort, which I had not
written as an empty element.
===============
I keep tripping up over 'attribute vs element content'
problems. I.e. when to use the empty element, when
to have it contain something; hence my amazement
at Davids use of variable last week.

Am I right in thinking this is one of XSLT's more 
subtle aspects, left to the user to work out?

Regards, DaveP


 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.