<?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>3072</bug_id>
          
          <creation_ts>2006-04-04 00:45:44 +0000</creation_ts>
          <short_desc>Which types have constructor functions?</short_desc>
          <delta_ts>2007-02-25 23:45:49 +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>XPath 2.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></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="C. M. Sperberg-McQueen">cmsmcq</reporter>
          <assigned_to name="Don Chamberlin">chamberl</assigned_to>
          
          
          <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>9017</commentid>
    <comment_count>0</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2006-04-04 00:45:44 +0000</bug_when>
    <thetext>XPath 3.10.4 (http://www.w3.org/TR/xpath20/#id-constructor-functions)
says

    For every atomic type in the in-scope schema types (except
    xs:NOTATION and xdt:anyAtomicType, which are not instantiable), a
    constructor function is implicitly defined. 

Functions and Operators 5.1 says

    Every built-in atomic type that is defined in [XML Schema Part 2:
    Datatypes Second Edition], except xs:NOTATION, has an associated
    constructor function; as do xdt:untypedAtomic, defined in Section
    2.6 TypesDM and the two derived types xdt:yearMonthDuration and
    xdt:dayTimeDuration defined in 10.3 Two Totally Ordered Subtypes
    of Duration. 

These seem to suggest two different answers to the questions

  Q1: is there a constructor function for xsd:anyAtomicType?

XPath seems to say no, F/O to say yes.

  Q2: are there constructors for user-defined atomic types among
  the in-scope types?

XPath seems to say yes, F/O to say no.  But then F/O continues

    A constructor function is not defined for xs:NOTATION since it is
    defined as an abstract type in [XML Schema Part 2: Datatypes
    Second Edition]. If the static context (See Section 2.1.1 Static
    ContextXP) contains a type derived from xs:NOTATION then a
    constructor function is defined for it. See 5.3 Constructor
    Functions for User-Defined Types.

which suggests that there ARE constructors for user-defined types, at
least if they are derived from NOTATION.

Are these really in contradiction, or am I missing something?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9018</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Rys">mrys</who>
    <bug_when>2006-04-04 02:41:54 +0000</bug_when>
    <thetext>The language book is correct in both counts.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9019</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-04-04 08:50:48 +0000</bug_when>
    <thetext>F+O 5.1 says that built-in atomic types have constructor functions.
F+O 5.3 says that user-defined atomic types have constructor functions.

You seem to have read 5.1 as saying that *only* built-in atomic types have constructor functions, which it doesn&apos;t say...

I don&apos;t think the specs are inconsistent about xdt:anyAtomicType either. F+O&apos;s phrase is 

    Every built-in atomic type that is defined in [XML Schema Part 2:
    Datatypes Second Edition], except xs:NOTATION, has an associated
    constructor function; as do xdt:untypedAtomic, defined in Section
    2.6 TypesDM and the two derived types xdt:yearMonthDuration and
    xdt:dayTimeDuration defined in 10.3 Two Totally Ordered Subtypes
    of Duration. 

The set of types described here does not include xdt:anyAtomicType. But it would do no harm to spell this out more explicitly.

Michael Kay</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9025</commentid>
    <comment_count>3</comment_count>
    <who name="Ashok Malhotra">ashok.malhotra</who>
    <bug_when>2006-04-04 16:12:53 +0000</bug_when>
    <thetext>We need to add a constructor function for anyAtomicType to the list of constructor functions listed in F&amp;O section 5.1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9026</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Rys">mrys</who>
    <bug_when>2006-04-04 16:15:38 +0000</bug_when>
    <thetext>No Ashok, we should NOT add this. This datatype is an abstract datatype and should NOT have a constructor!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9027</commentid>
    <comment_count>5</comment_count>
    <who name="Frans Englich">frans.englich</who>
    <bug_when>2006-04-04 16:20:53 +0000</bug_when>
    <thetext>
Ashok, not as I see it. It would counter act changes previously done concerning this(see bug #1526, for example). I neither see how it would make sense; anyAtomicType is an abstract type with no value space.


Regards,
Frans</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9947</commentid>
    <comment_count>6</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2006-06-06 16:21:29 +0000</bug_when>
    <thetext>Michael,
In telcon 296 on April 18, 2006, the joint Query and XSLT working groups agreed that the XPath and XQuery specifications are correct and that no document changes are required. If this resolution is acceptable to you, please change the status of this Bugzilla entry to &quot;Closed&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14151</commentid>
    <comment_count>7</comment_count>
    <who name="Jim Melton">jim.melton</who>
    <bug_when>2007-02-25 23:45:49 +0000</bug_when>
    <thetext>Closing bug because commenter has not objected to the resolution posted and more than two weeks have passed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>