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

Re: xsl:sort

Subject: Re: xsl:sort
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Jun 2004 15:05:35 -0400
xslt html dynamic attribute
At 2004-06-21 14:50 -0400, April Fleming wrote:
I am using xsl:sort to sort through rows of xml data, the code is dynamic so
that a user can specify what attribute to "order by".

Fine ... your approach in your message of working with the name of the attribute is fine provided that the attribute is not namespace qualified, in which case you have more work to do.


The problem is the
way that the xml data is formatted, optional attributes do not always exist,
so when i try to use one of these values in the <xsl:sort> it does not work
when all rows do not have that attribute.

How do you mean "does not work"? The standard is very well defined in this regard: if you do not have the attribute, the sort value is the empty string and all sorted items of the same value are presented in the result current node list in document order.


So the code works great if each
"row" has the given attribute, but does not if the row does not have the
attribute (like "device_os" below)   Any ideas?

Any ideas regarding what?


Let us know what do you want done with the rows for which there are no values, and we can give you our ideas about how to do what you want. It would be inappropriate to spend the time just guessing about what you need to have happen, as it is your application.

I hope this helps.

........................ Ken


-- Public training 3 days XSLT & 2 days XSL-FO: Phoenix,AZ 2004-08-23 World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal


Current Thread
  • xsl:sort
    • April Fleming - Mon, 21 Jun 2004 14:50:18 -0400
      • G. Ken Holman - Mon, 21 Jun 2004 15:05:35 -0400 <=

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.