Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-1683

array default values wrongly cause xerces to reject schema

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.7.0
    • 2.7.0
    • None
    • Win32 (occurred), probably all

    Description

      Xerces 2.7.0 fails to load the Schema grammar below at the 'defaultIntArray3Element' element with the message:

      "Value '4' with length '1' is not equal to length facet of '3'"

      Well, err, the specified default value is "4 3 2", which is an array of length 3.

      Replacing the restriction of the 'length' faced by restricting 'minLength' and 'maxLength' to 3 has the same result.

      An example schema that causes the trouble:

      <?xml version="1.0" encoding="utf-8" ?>
      <xs:schema
      xmlns="http://foo/test34"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      targetNamespace="http://foo/test34"
      >
      <!--
      Test34 tests default value handling
      -->
      <xs:simpleType name="intArray">
      <xs:list itemType="xs:int"/>
      </xs:simpleType>
      <xs:simpleType name="intArray3">
      <xs:restriction base="intArray">
      <xs:length value="3"/>
      </xs:restriction>
      </xs:simpleType>
      <xs:complexType name="Test34">
      <xs:sequence>
      <xs:element name="defaultIntArray3Element" type="intArray3" default="4 3 2"/>
      </xs:sequence>
      <attribute name="defaultIntArray3" type="intArray3" default="3 2 1"/>
      </xs:complexType>

      <!-- root element -->
      <xs:element name="test34" type="Test34"/>
      </xs:schema>

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bobby_newmark Uwe Pachler
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: