This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 3072 - Which types have constructor functions?
Summary: Which types have constructor functions?
Status: CLOSED INVALID
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XPath 2.0 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Don Chamberlin
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-04 00:45 UTC by C. M. Sperberg-McQueen
Modified: 2007-02-25 23:45 UTC (History)
0 users

See Also:


Attachments

Description C. M. Sperberg-McQueen 2006-04-04 00:45:44 UTC
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?
Comment 1 Michael Rys 2006-04-04 02:41:54 UTC
The language book is correct in both counts.
Comment 2 Michael Kay 2006-04-04 08:50:48 UTC
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't say...

I don't think the specs are inconsistent about xdt:anyAtomicType either. F+O'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
Comment 3 Ashok Malhotra 2006-04-04 16:12:53 UTC
We need to add a constructor function for anyAtomicType to the list of constructor functions listed in F&O section 5.1.
Comment 4 Michael Rys 2006-04-04 16:15:38 UTC
No Ashok, we should NOT add this. This datatype is an abstract datatype and should NOT have a constructor!
Comment 5 Frans Englich 2006-04-04 16:20:53 UTC
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
Comment 6 Don Chamberlin 2006-06-06 16:21:29 UTC
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 "Closed".
Comment 7 Jim Melton 2007-02-25 23:45:49 UTC
Closing bug because commenter has not objected to the resolution posted and more than two weeks have passed.