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

Sorting network addresses

Subject: Sorting network addresses
From: Craig W <codecraig@xxxxxxxxx>
Date: Wed, 2 Mar 2005 07:50:52 -0500
sorting network
Hi,
 Is there a way to extend the sort function provided by XSLT? I am
using XALAN. Basically, the elements that I need to sort need a more
specific sort than just text or number.

well the default sorts are on number or text. But say I want to sort
on network addresses, such as 1.2.3.4 ....text and number dont work
here, I need my own sorting (like i would do with a Comparator in
java)..

so if i had

1.2.3.4
170.1.3.3
2.4.3.2

I would want the sort to be like
1.2.3.4
2.4.3.2
170.1.3.3

...however (number sort wont work) and text sort does
1.2.3.4
170.1.3.3
2.4.3.2

see what i mean?

A sample XML may be like
...
<networks>
     <network>
             <address>1.2.3.4</address>
     </network>
     <network>
             <address>170.1.3.3</address>
     </network>
     <network>
             <address>2.4.3.2</address>
     </network>
</networks>

....after sort i would like...

<networks>
     <network>
             <address>1.2.3.4</address>
     </network>
     <network>
             <address>2.4.3.2</address>
     </network>
     <network>
             <address>170.1.3.3</address>
     </network>
</networks>


Someone suggested a key, but I am not sure how that works or how to
make it sort on a network address.  Any ideas?

Thanks,
Craig

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.