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

sort question

Subject: sort question
From: "Hahn, Kimberly" <Kim.Hahn@xxxxxxxxxx>
Date: Mon, 26 Feb 2001 10:17:08 -0600
what sort order id 42
I'm obviously missing something in reading through the sorting examples
available on many web sites.  All I want to do is obtain the same nodes out
of the transformation, just sorted.  Sort order is only applied to the KH
and Key nodes, the KH nodes sort by the KSort attribute value and within a
KH node, the Key nodes sort by the KeySort value.  No other nodes require
sorting, they should remain in the order they were in originally.  I keep
getting the same nodes in the same order they started with from the
transformation, I am not getting a sort applied.  Could someone enlighten me
as to what I am missing?

XSL:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
	<xsl:template match="/">
		<xsl:apply-templates select="Data/KH">
			<xsl:sort select="@KSort" data-type="text" order="ascending"/>
			<xsl:sort select="Key[@KeySort]" data-type="text" order="ascending"/>
		</xsl:apply-templates>
		<xsl:copy-of select="node()"/>
	</xsl:template>
</xsl:stylesheet>

XML:

<QuoteData>
<QuoteFilter CurrentIndex="0"><DefaultFilter CommodityID="1" ID="1">
<LocID V_1="266" V_2="267" />
<ProdID V_1="72" V_2="69" V_3="73" V_4="71"/>
</DefaultFilter>
</QuoteFilter>
<Data>
<Map schema="2" col0="12" col1="2" col2="2" col3="2" col4="2" >
<MapKey col0="0" col1="2" col2="5"/>
<MapMD col0="0"/>
<MapMy col0="0"/>
</Map>
</Data>
<Data><row ID="69"/><row ID="71"/><row ID="72"/><row ID="73"/><row
ID="74"/><row ID="75"/><row ID="76"/>
</Data>
<Data>
<KH KHID="13" KSort="NE TCO-POOL Basis IF">
<Key KeyID="598" KeySort="NE TCO-POOL 2001-11-01 2001-11-01 Basis IF" >
<MD Depth="1" QID="27984"/></Key>
</KH>
<KH KHID="108" KSort="AWEST SAN-JUAN (PAPER) Basis GD/D">
<Key KeyID="563" KeySort="AWEST SAN-JUAN (PAPER) 2001-04-01 2001-08-01 Basis
GD/D" >
<MD Depth="1" QID="28107"/>
<MD Depth="2" QID="28109"/>
</Key>
<Key KeyID="563" KeySort="AWEST SAN-JUAN (PAPER) 2001-01-01 2001-08-01 Basis
GD/D" >
<MD Depth="1" QID="29107"/>
<MD Depth="2" QID="29103"/>
</Key>
</KH>
</Data>
<Key KeyID="563" ProdID="73">
<My BidID="2879" AskID="2345"/>
</Key>
<Data>
</Data>
</QuoteData>


 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.