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

Re: XPath 1.5? (was RE: typing and markup)


date in xpath

Elliotte Rusty Harold wrote:
>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.

Amen.

This is one of the reasons why I find Tcl so useful for SGML
processing: it has a world view -- "everything is a string" --
that is perfectly compatible with markup.


> >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.

Agreed.  The simplest solution to the problem of people
needing to manipulate dates is to add functions that interpret
strings as dates and manipulate them.  Schemas and static
typing aren't necessary.


--Joe English

  jenglish@f...

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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.