W3C home > Mailing lists > Public > public-qt-comments@w3.org > July 2004

Re: Serialization (sometimes) needs to include type information

From: Henry Zongaro <zongaro@ca.ibm.com>
Date: Tue, 13 Jul 2004 10:10:36 -0400
To: antoine.mensch@xquarkgroup.com
Cc: public-qt-comments@w3.org
Message-ID: <OF6AABC0E5.4BA06975-ON85256ED0.004CA608-85256ED0.004DDC72@ca.ibm.com>


     In [1], you submitted the following comment on the Last Call Working 
Draft of XSLT 2.0 and XQuery 1.0 Serialization:

Consider the following schema fragment:

<xs:element name="A">
          <xs:element name="C" type="myns:Type1"/>

<xs:element name="B">
          <xs:element name="C" type="myns:Type2"/>

Now if we consider a document (or any other data source) containing
both A and B elements, the following query

    for $x in doc("myDocument")//C
    return $x

returns a result that cannot be strongly typed without losing type
information by any valid schema, as the schema spec forbids elements
with the same name and a different type in the same content model.

It seems to me that the only way of retaining type information would
be to annotate produced C elements with xsi:type. This could be a
serialization parameter, similar to the
cdata-section-elements. However, this would raise another issue, as
anonymous type names would then be exposed, and would thus require to
be handled in a consistent way by different XQuery and XML Schema

This issue is important, especially for tools that perform distributed
XQuery processing, and that need to retain consistent type information
when moving XML data from one processing node to another.

     Thank you for this comment.  The XSL and XML Query Working Groups 
discussed your comment and several related comments.  There was general 
agreement that there is some need for a mechanism that preserves most or 
all of the properties of the items in the sequence that is being 

     However, the working groups decided that precisely defining all of 
the requirements for such a mechanism at this stage would be difficult, 
and would likely lead to a solution that would not satisfy real user 
requirements.  Therefore, the working groups decided to consider such a 
feature for a future revision of the recommendations, and close this 
comment without any changes to the specifications.

     May I ask you to confirm that this response is acceptable to you?


Henry [On behalf of the XSL and XML Query Working Groups]
Henry Zongaro      Xalan development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
Received on Tuesday, 13 July 2004 10:13:27 UTC

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