[Home] [By Thread] [By Date] [Recent Entries]
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
|

Cart



