W3C home > Mailing lists > Public > public-qt-comments@w3.org > August 2009

[Bug 7239] New: [XQTS] New test for typed value of potentially namespace sensitive XDM nodes when copied with different in scope namespaces..

From: <bugzilla@wiggum.w3.org>
Date: Fri, 07 Aug 2009 10:56:12 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-7239-523@http.www.w3.org/Bugs/Public/>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=7239

           Summary: [XQTS] New test for typed value of potentially namespace
                    sensitive XDM nodes when copied with different in scope
                    namespaces..
           Product: XML Query Test Suite
           Version: unspecified
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XML Query Test Suite
        AssignedTo: andrew.eisenberg@us.ibm.com
        ReportedBy: oliver@cbcl.co.uk
         QAContact: public-qt-comments@w3.org


Our XDM node representation consisted of storing the (static) schema type of a
node (from validation, or copying) and the string value for simple typed
elements.  The typed value of the node is computed from the string value with
the schema type.  

I am not sure if it was an intention of the specifications to allow this
representation.  The specification makes no claims that this should be
equivalent, but for example the XQST0086 error seems to prevent the other cases
where this representation would not be safe.  

In order to illustrate the problem, I propose that this case should be added to
XQTS as a test.

First off we need to have a schema:

<xs:schema targetNamespace="http://www.xqsharp.com/test/namespace-sensitive"
           xmlns="http://www.xqsharp.com/test/namespace-sensitive"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           elementFormDefault="qualified">

  <xs:simpleType name="myString">
    <xs:restriction base="xs:string"/>
  </xs:simpleType>

  <xs:simpleType name="union">
    <xs:union memberTypes="xs:QName myString" />
  </xs:simpleType>

  <xs:simpleType name="list">
    <xs:list itemType="union" />
  </xs:simpleType>

  <xs:element name="root" type="list" />

</xs:schema>


Next we need a source document validated against this schema:

<root xmlns="http://www.xqsharp.com/test/namespace-sensitive"
      xmlns:foo="http://www.example.org/foo/">
  foo:test bar:test
</root>


Finally we need the following query which imports the document as
$input-context

declare construction preserve;
declare copy-namespaces no-preserve,inherit;
import schema namespace ns="http://www.xqsharp.com/test/namespace-sensitive";

declare variable $input-context external;

let $node := <e
xmlns:bar="http://www.example.org/bar">{$input-context/ns:root}</e>
return data($node/ns:root)[2] instance of ns:myString


$node from the query looks something like this:

<e xmlns:bar="http://www.example.org/bar">
  <root xmlns:foo="http://www.example.org/foo">
    foo:test bar:test
  </root>
</e>

Note that the schema type of the root element of the source document is a list
of unions of QNames and myStrings, and the typed value is a QName followed by a
myString.  The typed value of the root node should have been copied, and so
should also be a QName followed by a myString.  Thus the query should return
true.  

However, if the node representation stores just the schema type (a list of
QNames and myStrings) and the value ("foo:test bar:test") then the typed value
is computed as two QNames and the query returns false.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Friday, 7 August 2009 11:07:48 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:40 UTC