MultiLengths pattern in XHTML 1.0 schema incorrect

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 UTC