W3C home > Mailing lists > Public > www-html-editor@w3.org > January to March 2005

MultiLengths pattern in XHTML 1.0 schema incorrect

From: Christoph Schneegans <Christoph@Schneegans.de>
Date: Fri, 21 Jan 2005 23:13:25 GMT
To: <www-html-editor@w3.org>
Message-ID: <css5r5.3b8.1@mail.christoph.schneegans.de>

Hello!

<http://www.w3.org/TR/2002/NOTE-xhtml1-schema-20020902/> defines the
following types:

  <xs:simpleType name="Length">
    <xs:restriction base="xs:string">
      <xs:pattern value="[-+]?(\d+|\d+(\.\d+)?%)"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="MultiLength">
    <xs:restriction base="xs:string">
      <xs:pattern value="[-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="MultiLengths">
    <xs:restriction base="xs:string">
      <xs:pattern
          value="[-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*(,\s*[-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*)*"/>
    </xs:restriction>
  </xs:simpleType>

Obviously, the "MultiLengths" pattern is based on the "MultiLength"
pattern which is based on the "Length" pattern. However, additional
parentheses are needed in the "MultiLengths" pattern to make it work
as intended:

      <xs:pattern
          value="([-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*)(,\s*([-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*))*"/>

-- 
<http://schneegans.de/>                                              |
Received on Friday, 21 January 2005 23:19:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:17:54 GMT