[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: [XSL] Declaring datatypes for Attributes
Hi Bernard, > I knew that the type declaration was possible using schema but I > thought that there was no tool which manage schema. XSLT processors don't use schema information (not in XSLT 1.0, they will in XSLT 2.0). However, you can still tell it to sort numerically rather than alphabetically. It's not about the type of the node that you're sorting by, actually, it's about the type of the sort value, which might be something that's calculated. For example, you could sort by year with: <xsl:sort select="substring(@date, 7)" data-type="number" /> or the result of multiplying orderqty and price: <xsl:sort select="@orderqty * @price" data-type="number" /> I suspect that in XSLT 2.0 there will be more data types based on the XML Schema built-in data types, so you'll be able to do things like: <xsl:sort select="@date" data-type="xs:date" /> However, again it's about the type of the sort value, not the node that's used to get the sort value, since the sort value might come from something other than a simple node. Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|