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

Re: [XSL] Declaring datatypes for Attributes

Subject: Re: [XSL] Declaring datatypes for Attributes
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Thu, 10 May 2001 12:29:05 +0100
xsl data types
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


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.