This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: XSLT/XPath 2.0 (was "Identifying two tags...")


At 7:48 PM +0100 5/14/02, Francis Norton wrote:

>Not sure whether it's possible or not, but I certainly don't like 
>the idea of re-inventing XML Schema data types such as dates in XSLT 
>or XPath.
>
>I like the idea of being able to apply functions that depended on 
>XML Schema data types in the absence of a PSVI, but I would hate to 
>re-invent the data types incompatibly.
>

That's not necessary at all. Remember, schema or no schema all an XML 
document really contains is strings. I'm saying the 
getYear("1999-09-12") function should return the same value 
regardless of what the schema may say about the type of the string 
that it's passed.  If the schema says that's a date, great! If the 
schema says it isn't a date, the function works just the same and 
still returns 1999.

In reverse if I call getYear("Barney") I expect the function to fail 
or return some error value, regardless of what the schema says about 
the type of the string I pass it.

You need to remember that a lot of the functions people are asking 
for that handle dates, numbers, and other types are implemented 
*today* in EXSLT. We do not need string typing to add these to the 
language. They work *today* in weakly typed XSLT 1.0. Do not confuse 
the need for date functions with the much less important need for 
date types, and similarly for the other schema types.

I am explicitly asking for weak typing in XSLT 2.0.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|             http://www.cafeconleche.org/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]