W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2002

Bug in the Schemas for schemas

From: by way of <veillard@redhat.com>
Date: Wed, 03 Apr 2002 14:04:08 -0500
Message-Id: <>
To: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>
   Apparently the regular expressions given for matching XPath
strings are incorrect:

XMLSchema.xsd around line 1061 (there is a similar problem for
the "selector" definition).

      <xs:attribute name="xpath" use="required">
         <xs:documentation>A subset of XPath expressions for use
in selectors</xs:documentation>
         <xs:documentation>A utility type, not for public
        <xs:restriction base="xs:token">
          <xs:documentation>The following pattern is intended to allow XPath
                            expressions per the following EBNF:
           Selector    ::=    Path ( '|' Path )*
           Path    ::=    ('.//')? Step ( '/' Step )*
           Step    ::=    '.' | NameTest
           NameTest    ::=    QName | '*' | NCName ':' '*'
                            child:: is also allowed

   Accordingly to the documentation, and also XPath path definition, one
would not expect "a:1" to be matched isn't it ?

   Though I was surprized by the result of one of my tests:

paphio:~/regexp -> ./testRegexp 
a:1: Ok
paphio:~/regexp ->

   which can be reduced to:

paphio:~/regexp -> ./testRegexp '(\i\c*)' 'a:1'
a:1: Ok
paphio:~/regexp ->

   Ah ... Back to the definition:

   \c  the set of name characters, those matched by NameChar

   Which point to:

   [4]    NameChar   ::=    Letter | Digit  | '.' | '-' | '_' | ':' |
                            CombiningChar | Extender

   and ':' is part of NameChar as defined by the XML specification.

XPath when defining the NameTest actually referenced the Namespace in XML REC
to avoid this problem:


   [4] NCName  ::= (Letter | '_') (NCNameChar)* /* An XML Name, minus the 
":" */
   [5] NCNameChar  ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | 

    - The Schemas for Schemas does not define a subset of XPath, damn...

    - Change the definition to base it either on the XPath specification or
      Namespace in XML specs references
    - Change the regular expression occurences of "\i\c*"
    - For the record I concur with others on the opinion that
      XML Schema Part 1: Structures is nearly impossible to understand
      and should be rewritten with more prose an without sentences longer than
      25 words.

    - Did anyone implemented Schemas by actually reading the specification
      and transcribing it litterally using a programming language ?



Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ 
Received on Wednesday, 3 April 2002 14:07:05 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:08:58 UTC