Lists Home |
Date Index |
> At 2003-02-15 09:37, G. Ken Holman wrote:
>>Because XML 1.0 is easy for documents and the evolution of the W3C
>>specifications has not been respecting the ease of use for document
>>models or document use. For example, knowing a text construct
>>validly represents a number while still being able to access it as
>>the original string of text authored by the user.
> I'm not sure I follow you here. What specs prevent you from
> accessing the original string? XML Schema certainly doesn't: the
> input infoset is, by definition, unchanged by XML Schema processing.
In XQuery 1.0 and XPath 2.0, it's legal for an implementation to
reconstruct the string value of an attribute or element based on
canonical representation of the typed value of that node. The original
string value is lost in these cases. For example, in such a
"value-only" implementation, round-tripping:
This is the case even when the lexical representation of a
user-defined data type is constrained using the pattern facet (for
example a monetary type that insists on two decimal places). Thus if
you use a value-only implementation to round-trip data of a data type
in which the legal set of lexical representations does not include the
canonical lexical representation for the primitive type from which
it's derived, you will get an invalid document out.
Whitespace normalisation also has an effect on the string values of
elements and attributes, of course, though rather less consequential.