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 3025 - Lexical mappings are not necessarily functions
Summary: Lexical mappings are not necessarily functions
Status: CLOSED FIXED
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Datatypes: XSD Part 2 (show other bugs)
Version: 1.1 only
Hardware: PC Linux
: P1 major
Target Milestone: ---
Assignee: C. M. Sperberg-McQueen
QA Contact: XML Schema comments list
URL:
Whiteboard: cluster: effability
Keywords: resolved
: 3229 (view as bug list)
Depends on: 5058
Blocks:
  Show dependency treegraph
 
Reported: 2006-03-21 02:04 UTC by C. M. Sperberg-McQueen
Modified: 2008-05-23 19:39 UTC (History)
1 user (show)

See Also:


Attachments

Description C. M. Sperberg-McQueen 2006-03-21 02:04:02 UTC
The discussions of the lexical mappings of the special types and
of unions makes clear that the lexical mapping of a datatype is
not necessarily a function.

Under these circumstances, it is perhaps unnecessarily confusing to
define 'lexical mapping' as is done in section 2.3 as "a prescribed 
function whose domain is a prescribed set of character strings 
(the ·lexical space·) and whose range is the ·value space· of that 
datatype."

Proposed repair: for 'function' read 'relation'.
Comment 1 C. M. Sperberg-McQueen 2006-10-09 18:17:57 UTC
The same error occurs in section 2.1, although not elsewhere, as
far as I can tell by examining sentences containing the word
'mapping'.

A possible solution is: in section 2.1, replace 

    [Definition:] In this specification, a datatype has three
    properties:

      ...

      * A small collection of functions, relations, and
        procedures associated with the datatype.  Included are
        equality and order relations on the ·value space·, and a
        ·lexical mapping·, which is a function on the ·lexical
        space· onto the ·value space·.

with

    [Definition:] In this specification, a datatype has three
    properties:

      ...

      * A small collection of functions, relations, and
        procedures associated with the datatype.  Included are
        equality and order relations on the ·value space·, and a
        ·lexical mapping·, which is a mapping from the ·lexical
        space· onto the ·value space·.

And in section 2.3, replace the first paragraph

    [Definition:] The lexical mapping for a datatype is a
    prescribed function whose domain is a prescribed set of
    character strings (the ·lexical space·) and whose range is
    the ·value space· of that datatype.

with (draft A):

    [Definition:] The lexical mapping for a datatype is a
    prescribed relation whose domain is a prescribed set of
    character strings (the ·lexical space·) and whose range is
    the ·value space· of that datatype.

        Note: For each primitive datatype defined here, the
        lexical mapping is a total function from the lexical
        space onto the value space of the datatype.  

        For unions, the lexical mapping may or may not be a
        function; when a lexical representation maps to more than
        one value in the union, the choice of which value to use
        for further processing is determined by the order of the
        members of the union, or (when performing schema-validity
        assessment as defined in [XML Schema Part 1: Structures])
        an xsi:type attribute in the document instance.

        For the special datatypes, the lexical mapping is not a
        function, since the same character sequence may map to
        several values. When a lexical representation maps to
        more than one value, the choice of which value to use for
        further processing is not determined by this
        specification; when performing schema-validity assessment
        as defined in [XML Schema Part 1: Structures], the value
        to be used may be determined by rules given there.  In
        the case of anySimpleType, alone among datatypes defined
        here, the lexical mapping is also not a function onto the
        value space, because there are values with no lexical
        representation.

or (draft B):

    [Definition:] The lexical mapping for a datatype is a
    prescribed relation whose domain is a prescribed set of
    character strings (the ·lexical space·) and whose range is
    the ·value space· of that datatype.

        Note: For each primitive datatype defined here, the
        lexical mapping is a total function from the lexical
        space onto the value space of the datatype.  

        For unions and special datatypes, the lexical mapping is
        not a function, since the same character sequence may map
        to several values.  When a lexical representation maps to
        more than one value, the choice of which value to use for
        further processing may be determined by rules given
        elsewhere (for unions, by the order of the members of the
        union; when performing schema-validity assessment as
        defined in [XML Schema Part 1: Structures] by rules given
        there; otherwise, by rules given in other
        specifications).

        For every datatype except anySimpleType, the lexical
        mapping maps *onto* the value space of the datatype
        (i.e., every member of the value space is mapped to by
        some lexical representation).  In the case of
        anySimpleType, alone among datatypes defined here, the
        lexical mapping is also not a function onto the value
        space, because there are values with no lexical
        representation.
    
or (draft C):

    [Definition:] The lexical mapping for a datatype is a
    prescribed relation whose domain is a prescribed set of
    character strings (the ·lexical space·) and whose range is
    the ·value space· of that datatype.

        Note: For each primitive datatype defined here, the
        lexical mapping is a total function from the lexical
        space onto the value space of the datatype.  

        For unions and special datatypes, the lexical mapping is
        not a function, since the same character sequence may map
        to several values.  When a lexical representation maps to
        more than one value, the choice of which value to use for
        further processing may be determined by rules given
        elsewhere.

As currently defined, anySimpleType has values without lexical
representations; that fact is noted in drafts A and B, but not C.
It should also be noted in section 3.2.1, but that change is not
part of this proposal; it belongs to bug 3243.
Comment 2 Dave Peterson 2006-10-09 19:54:19 UTC
(In reply to comment #1)

> And in section 2.3, replace the first paragraph

> with (draft A):
> 
>     [Definition:] The lexical mapping for a datatype is a
>     prescribed relation whose domain is a prescribed set of
>     character strings (the ·lexical space·) and whose range is
>     the ·value space· of that datatype.

>                                                             In
>         the case of anySimpleType, alone among datatypes defined
>         here, the lexical mapping is also not a function onto the
>         value space, because there are values with no lexical
>         representation.

If the value space isn't always the range of the relation, then we shouldn't say it is in the definition.  The exception needs to be noted within the definition.  E.g.:

    [Definition:] The lexical mapping for a datatype is a
    prescribed relation whose domain is a prescribed set of
    character strings (the ·lexical space·) and whose range is
    the ·value space· of that datatype, except that the
    ·value space· of anySimpleType has values that are
    not in the range of the ·lexical space·.

Similar rewordings needed elsewhere.
Comment 3 Dave Peterson 2006-11-04 02:15:40 UTC
*** Bug 3229 has been marked as a duplicate of this bug. ***
Comment 4 Dave Peterson 2006-11-04 04:08:18 UTC
(In reply to comment #1)
> The same error occurs in section 2.1, although not elsewhere, as
> far as I can tell by examining sentences containing the word
> 'mapping'.

$.1.4 says in part "Note:  Since every value in the ·value space· is denoted by some ·literal·, and every ·literal· in the ·lexical space· maps to some value,...." which, as you say, is not true for anySimpleType.  So that particular search missed at least one.
Comment 5 Dave Peterson 2006-11-04 04:19:25 UTC
(In reply to comment #4)

> $.1.4 

#%^@$%!  Obviously, s/$/4/.  Also, more precisely, that Note occurs in "Validation Rule: Datatype Valid".
Comment 6 Dave Peterson 2007-09-18 02:08:02 UTC
(In reply to comment #1)

The existence of the exception for anySimpleType depends on bug 5058, which addresses the question of whether there should be values that are not in the value space of any primitive datatype or currently definable list datatype.
Comment 7 C. M. Sperberg-McQueen 2007-10-14 18:29:39 UTC
Any wording proposal for this should be coupled with resolution of
bug 3243 and bug 5058.  Accordingly, I'm marking this needsDrafting
to agree with those issues.
Comment 8 C. M. Sperberg-McQueen 2008-05-21 12:29:50 UTC
A wording proposal intended to resolve this issue is available at
http://www.w3.org/XML/Group/2004/06/xmlschema-2/datatypes.b3025.html
(member-only link).
Comment 9 C. M. Sperberg-McQueen 2008-05-23 19:39:10 UTC
The wording proposal mentioned in comment #3 was adopted by the XML Schema
WG on its telcon today.  Accordingly, I'm marking this issue resolved.