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

RE: XSL sorting

Subject: RE: XSL sorting
From: "Andrew Welch" <andrew@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Jan 2002 15:58:51 -0000
xsl attr id syntax
Hi,

Try putting the condition 'some value' in the template call, and then sort
by 'data'.  So you could use:

<xsl:template match="logger">
<xsl:apply-templates select="attrList/attr/name[.='some value']">
  <xsl:sort order="ascending" select="attrList/attr/data"/>
</xsl:apply-templates>
</xsl:template>

I hope this helps (although it may not be the best way...)

cheers

andrew

===


-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Gourevitch
Maia-BMG022
Sent: Monday, January 21, 2002 3:10 PM
To: 'XSL-List@xxxxxxxxxxxxxxxxxxxxxx'
Subject:  XSL sorting


	Hi!

I've been working on XML/XSL project.
I have the problem with a sorting.

My XML source is:

<Event>
	<attrList>
		<attr id="i0_0">
  			<name>trap type</name>
  			<data>COLD START</data>
  		</attr>
		.........................

	</attrList>
</Event>

I'd like to sort all events by attrList/attr/data, where
attrList/attr/name="some value",
						for example: trap type.

I've tried to use key for sorting, but it is not working. For example:

<xsl:key name="sortparam" match="event/attrList/attr/data"
use="event/attrList/attr/name"/>

<xsl:template match="logger">
	<xsl:apply-templates>
		<xsl:sort order="ascending" select="key('sortparam','trap type')"/>
	</xsl:apply-templates>
</xsl:template>

Please, help me with this problem.

Regards,
	Maia.

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



 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.