RE: Ref XSCH-QL-018: Example of pblm with serialization-based validation

This problem is certainly a known one. But it's not serialization that
causes the problem, it's the fact that the constructs that create nodes on
the result tree (in both XSLT and XQuery) convert values to strings and
discard the type information. (The infamous "Alternative 1".)

Michael Kay

# -----Original Message-----
# From: public-qt-comments-request@w3.org [mailto:public-qt-comments-
# request@w3.org] On Behalf Of Henry S. Thompson
# Sent: 06 March 2004 15:11
# To: public-qt-comments@w3.org
# Subject: Ref XSCH-QL-018: Example of pblm with serialization-based
# validation
# 
# 
# Consider the following schema document and instance:
# 
# <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
#  <xs:element name="root">
#   <xs:simpleType>
#    <xs:restriction base="xs:decimal">
#     <xs:annotation>
#      <xs:documentation>Always two signif. digits</xs:documentation>
#     </xs:annotation>
#     <xs:pattern value=".*\..."/>
#    </xs:restriction>
#   </xs:simpleType>
#  </xs:element>
# </xs:schema>
# 
# <root>3.00</root>
# 
# The instance is valid per the schema corresponding to the schema document.
# 
# A query which attempted to construct an element including this one
# would however fail, as I read the spec., because the serialization
# would include <root>3.0</root>, which is invalid per the type.
# 
# ht
# --
#  Henry S. Thompson, HCRC Language Technology Group, University of
# Edinburgh
#                      Half-time member of W3C Team
#     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
#             Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
#                    URL: http://www.ltg.ed.ac.uk/~ht/
# [mail really from me _always_ has this .sig -- mail without it is forged
# spam]

Received on Saturday, 6 March 2004 16:41:37 UTC