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 4087 - XPath used for "assertion" should not use "token"
Summary: XPath used for "assertion" should not use "token"
Status: CLOSED FIXED
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.1 only
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: C. M. Sperberg-McQueen
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords: resolved
Depends on:
Blocks:
 
Reported: 2006-12-15 16:42 UTC by Sandy Gao
Modified: 2009-04-21 19:21 UTC (History)
0 users

See Also:


Attachments

Description Sandy Gao 2006-12-15 16:42:20 UTC
Tokne has whiteSpace "collapse", which means if an XPath has a string literal that contains consecutive whitespaces or new line/tab characters, they will be normalized, which may not be what's intended by the schema author.

Suggest to change the type to xs:string or a type derived from xs:string.
Comment 1 Dave Peterson 2006-12-15 17:40:09 UTC
(In reply to comment #0)

> Suggest to change the type to xs:string or a type derived from xs:string.
> 
> Tokne has whiteSpace "collapse", which means if an XPath has a string literal
>that contains consecutive whitespaces or new line/tab characters, they will be
>normalized, which may not be what's intended by the schema author.

As I read the XPath spec, when they say "token" they don't necessarily mean a character string in the Schema token datatype's value space.  I can't find any place where XPATH itself requires that a character string be Schema-tokenized or even whiteSpace-collapsed.  Help me out here.
Comment 2 C. M. Sperberg-McQueen 2007-02-22 20:39:51 UTC
The reference is not to any use of the term 'token' in XPath
documentation; the reference is to the schema for schemas, which
currently says in part

        <xs:attribute name="test">
          <xs:simpleType>
            <xs:annotation>
              <xs:documentation>A subset of XPath expressions for use in assertion tests</xs:documentation>
            </xs:annotation>
            <xs:restriction base="xs:token">
            </xs:restriction>
          </xs:simpleType>
        </xs:attribute>

The point is well taken; this should be fixed.

There is no need for tokenization by the schema processor
in any case, since it will be performed by the XPath processor.
The XPath processor's tokenization will be more reliable,
since it will be informed by the XPath grammar in ways that
XSD whitespace processing is not.
Comment 3 Mary Holstege 2007-03-09 17:51:05 UTC
Fixed: see minutes http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2007Mar/0010.html