- From: <bugzilla@jessica.w3.org>
- Date: Fri, 19 Sep 2014 19:21:17 +0000
- To: public-qt-comments@w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=26865
Bug ID: 26865
Summary: CastableAs653 and CastableAs654 should expect false
instead of true
Product: XML Query Test Suite
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P2
Component: XML Query Test Suite
Assignee: benjie.nguyen@gmail.com
Reporter: josh.spiegel@oracle.com
QA Contact: public-qt-comments@w3.org
CastableAs653 should expect false instead of true
<test-case name="CastableAs653"
xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<description>Pattern must match canonical representation (not the result
of string())</description>
<created by="Michael Kay" on="2013-04-08"/>
<environment ref="derived"/>
<dependency type="spec" value="XQ10+"/>
<dependency type="feature" value="schemaImport"/>
<test><![CDATA[
import schema namespace d="http://www.w3.org/XQueryTest/derivedTypes";
12 castable as d:canonicalDecimal
]]></test>
<result>
<assert-true/>
</result>
</test-case>
d:canonicalDecimal:
<xs:simpleType name="canonicalDecimal">
<xs:restriction base="xs:decimal">
<xs:pattern value="-?[0-9]+\.[0-9]+"/>
</xs:restriction>
</xs:simpleType>
We think the result of this query should be false.
http://www.w3.org/TR/xpath-functions-30/#casting-within-branch
"If the value does not conform to the facets defined for the target type, then
a dynamic error is raised [err:FORG0001]. See [XML Schema Part 2: Datatypes
Second Edition]. In the case of the pattern facet (which applies to the lexical
space rather than the value space), the pattern is tested against the canonical
lexical representation of the value, as defined for the source type (or the
result of casting the value to an xs:string, in the case of types that have no
canonical lexical representation defined for them).
Note that this will cause casts to fail if the pattern excludes the canonical
lexical representation of the source type. For example, if the type my:distance
is defined as a restriction of xs:decimal with a pattern that requires two
digits after the decimal point, casting of an xs:integer to my:distance will
always fail, because the canonical representation of an xs:integer does not
conform to this pattern."
--
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Friday, 19 September 2014 19:21:18 UTC