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

Creating a padded sort key: easier from elt sequence o

Subject: Creating a padded sort key: easier from elt sequence or string?
From: Yves Forkl <Y.Forkl@xxxxxx>
Date: Tue, 25 Jul 2006 11:43:21 +0200
padded sequence

I'm lucky to be able to define some XML structure largely according to the needs of (XSLT) processing.

I have strings of variable length consisting of numbers and letters separated by dots, like "3.11.A.9" or "3.2.B.7".

Each of these strings shall take the role of a value for a sort key, but only after padding each number with sufficient zeros in order to sort "3.11.A.9" after and not before "3.2.B.7" (then "3.02.B.7"). The letters are always single letters, and the numbers have no more than 3 digits.

My question is as follows: which XML representation is more convenient when trying to fulfil this task in XSLT 1.1?

1) a PCDATA element containing a string like the ones above

2) an element containing a sequence of PCDATA elements, one for each of the numbers and letters (the dot in between may be added during processing)

And what's the best way of going about implementing the creation of the padded sort keys in XSLT from the more favorable representation? Would the solution differ much in XSLT 2.0?

Any hints are very much appreciated.


Current Thread


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.
First Name
Last Name
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.