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

Re: Ordering by child node attribute

Subject: Re: Ordering by child node attribute
From: Marc <Marc.Liste@xxxxxxx>
Date: Tue, 27 Dec 2011 14:48:55 +0100
Re:  Ordering by child node attribute
Hi,
You can use the collation with the parameter alphanumeric.
Marc

Le 27/12/2011 14:40, Gian Paolo Bernardini - TeleTu a icrit :
Hi all,

I'd like to order an xml from this form:

<?xml version="1.0" encoding="UTF-8"?>
<root>
	<Class code="B" kind="component">
		<SubClass code="b1"/>
		<SubClass code="b2"/>
	</Class>
	<Class code="b1" kind="chapter">
		<SuperClass code="B"/>
		<SubClass code="b110-b139"/>
	</Class>
	<Class code="b2" kind="chapter">
		<SuperClass code="B"/>
		<SubClass code="b210-b229"/>
	</Class>
	<Class code="b110-b139" kind="block">
		<SuperClass code="b1"/>
		<SubClass code="b110"/>
	</Class>
	<Class code="b210-b229" kind="block">
		<SuperClass code="b2"/>
		<SubClass code="b210"/>
	</Class>
	<Class code="b110" kind="fourdigit">
		<SuperClass code="b110-b139"/>
	</Class>
	<Class code="b210" kind="fourdigit">
		<SuperClass code="b210-b229"/>
	</Class>
</root>

to this form:

<?xml version="1.0" encoding="UTF-8"?>
<root>
	<Class code="B" kind="component">
		<SubClass code="b1"/>
		<SubClass code="b2"/>
	</Class>
	<Class code="b1" kind="chapter">
		<SuperClass code="B"/>
		<SubClass code="b110-b139"/>
	</Class>
	<Class code="b110-b139" kind="block">
		<SuperClass code="b1"/>
		<SubClass code="b110"/>
	</Class>
	<Class code="b110" kind="fourdigit">
		<SuperClass code="b110-b139"/>
	</Class>
	<Class code="b2" kind="chapter">
		<SuperClass code="B"/>
		<SubClass code="b210-b229"/>
	</Class>
	<Class code="b210-b229" kind="block">
		<SuperClass code="b2"/>
		<SubClass code="b210"/>
	</Class>
	<Class code="b210" kind="fourdigit">
		<SuperClass code="b210-b229"/>
	</Class>
</root>

I can't use 'sort' or 'grouping-by' because it returns for example b110
before b110-b139, which is not what I'm searching for.
If anyone has an idea it would be glad :)
Thanks in advance and happy new year

PS. currently I'm using SaxonHE9-4-0-1J, sometimes Xalan. I've no
constraints on the XSL versions.

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.