W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2003

Re: Are all values stored as strings?

From: Jeni Tennison <jeni@jenitennison.com>
Date: Mon, 12 May 2003 15:38:28 +0100
Message-ID: <92-1419841003.20030512153828@jenitennison.com>
To: "Roger L. Costello" <costello@mitre.org>
CC: xmlschema-dev@w3.org

Hi Roger,

> Now, here is an example of an instance of "num":
> <num>32</num>
> Question: is it correct that num's value (32) is always represented
> as a "string", regardless of how num is declared? That is, are all
> values just strings, with a "datatype label" associated with the
> string?

In XPath 2.0 and XQuery, implementations are free to store the value
of a node as either the lexical form + a type annotation or the typed

The important consequence of this is that if the <num> element is
typed as a numeric type and you have:


and then do:

  <xsl:value-of select="num/text()" />

then an implementation that stores the typed value will return "32"
whereas an implementation that stores the lexical form + type
annotation will return "0032".

From the looks of it, I think it's likely that most XQuery
implementations will store the typed value while most XSLT 2.0
implementations will store the lexical form + a type annotation.



Jeni Tennison
Received on Monday, 12 May 2003 10:38:36 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:11 UTC