OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] XPath 1.5? (was RE: [xml-dev] typing and markup)

[ Lists Home | Date Index | Thread Index ]

Admittedly I am just restating the problem, but I am curious to know why you
are so convinced that the data in XML documents are strings that can be
translated into other data types when necessary, and not dates, number, etc.
that are serialized as strings when an XML document is instantiated. The
counterargument, which strikes me as extremely compelling, is that
practically every environment *other* than an XML document would benefit
from explicit use of the underlying datatypes. This includes storage
engines, user interfaces (where formatting, localization and type/range
checking must occur), most popular programming languages, etc. I can
certainly say from my experience programming in Java and C++ that I would
prefer for a number to be a number and for a date to be a date, rather than
having to constantly convert back and forth.

Matt

> -----Original Message-----
> From: Elliotte Rusty Harold [mailto:elharo@metalab.unc.edu]
> Sent: Tuesday, May 07, 2002 2:14 PM
> To: xml-dev@lists.xml.org
> Subject: RE: [xml-dev] XPath 1.5? (was RE: [xml-dev] typing 
> and markup)
> 
> 
> At 9:31 AM +0100 5/7/02, Michael Kay wrote:
> 
> >I don't think it's acceptable, if people go to
> >the trouble of defining the data types they are using in 
> their documents,
> >that XPath and XSLT should ignore this information and treat 
> eveything as if
> >it were text (or guess that it might be a number, as XPath 1.0 does).
> 
> It is all text. The idea that there are any numbers whatsoever in an 
> XML document is an illusion that is sometimes useful in a particular 
> local processing environment. XSLT should allow particular strings to 
> be converted to numbers (including NaN) at the specific request of 
> the stylesheet. The stylesheet needs to be in control, not the 
> schema. If the stylesheet says it's a number, then it's a number, 
> whether the schema agrees or not.
> 
> >Anyway, we get messages every week on xsl-list from people 
> asking how to
> >manipulate dates. I would love to reduce the complexity of 
> the solution, but
> >I don't think we can deny that the requirement exists.
> >
> 
> There are no dates in XML documents either. There are strings and 
> elements which some local processing environments may choose to treat 
> as dates. In fact, I'm already doing this today using EXSLT, without 
> any schema anywhere in sight. Schemas are no more necessary to add 
> date processing functions to XSLT than they are to add numbers. This 
> is a huge red herring.
> -- 
> 
> +-----------------------+------------------------+-------------------+
> | 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/    |
> +----------------------------------+---------------------------------+
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>
> 




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS