<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>7353</bug_id>
          
          <creation_ts>2009-08-17 18:45:47 +0000</creation_ts>
          <short_desc>[XSLT 2.0] Handling an atomic value of type other than xs:string, xs:anyURI or xs:untypedAtomic with the document function</short_desc>
          <delta_ts>2010-07-15 16:54:44 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XSLT 2.0</component>
          <version>Recommendation</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.w3.org/TR/xslt20/#document</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Henry Zongaro">zongaro</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>tim</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>26493</commentid>
    <comment_count>0</comment_count>
    <who name="Henry Zongaro">zongaro</who>
    <bug_when>2009-08-17 18:45:47 +0000</bug_when>
    <thetext>The signatures of the document function in section 16.1 of XSLT 2.0[1] are 

 document($uri-sequence as item()*) as node()*
 document($uri-sequence as item()*, $base-node as node()) as node()*

The first bullet in that section describes the behaviour of the function if an item in $uri-sequence is of type xs:string, xsl:anyURI or xs:untypedAtomic.  It does not indicate what should happen if an item is an atomic value of any other type.  The second bullet indicates that if $uri-sequence is a node, it is atomized, and every item in the atomized sequence MUST be of type xs:string, xsl:anyURI or xs:untypedAtomic.

In XSLT 1.0, if the first argument to the document function was not a node, it was converted to string as if by a call to the string function.[2]  If that was the intended behaviour in the case of an atomic value of a type such as xs:boolean, that needs to be explicitly stated.  If it was intended to be an error, that should be stated as well, and the incompatibility noted in appendix J.1.4.

As for a node whose typed value contains items of types other than the three mentioned, it seems clear that that is expected to be a type error, but the required error code is not mentioned by the second bullet.

[1] http://www.w3.org/TR/xslt20/#document
[2] http://www.w3.org/TR/xslt#function-document</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35674</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-05-13 16:49:59 +0000</bug_when>
    <thetext>Proposal is to throw XPTY0004 if the value (after atomization if necessary) is not a sequence consisting entirely of xs:string, xs:anyURI, and xs:untypedAtomic values. This resolution is agreed in principle subject to detailed text.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35937</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-06-03 13:02:12 +0000</bug_when>
    <thetext>*** Bug 9842 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36888</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-07-15 08:48:18 +0000</bug_when>
    <thetext>Erratum 41 will be raised to implement the decision in comment #1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36928</commentid>
    <comment_count>4</comment_count>
    <who name="Henry Zongaro">zongaro</who>
    <bug_when>2010-07-15 16:54:44 +0000</bug_when>
    <thetext>Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>