Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1091

xml validation performance bad when maxOccurs is big

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.0.0 [beta 4]
    • None
    • SAX
    • None
    • Solaris 9

    Description

      For the following schema, the validation of a XML file (with only one record) against this schema took several minutes. But if the maxOccurs="9999" change to maxOccurs="999", the validation takes 2 second. I was able to get around it by using "unbounded". Don't understand why 9999 could cause such a big differnce for validation.

      ....
      <complexType name="MatListType">^M
      <sequence>^M
      <element name="MatItem" minOccurs="0" maxOccurs="9999">^M
      <complexType>^M
      <sequence>^M
      <element name="SequenceNumber" type="wvd:A082_LIN_ITM_NO"/>^M
      <element name="Material" type="sg:Material"/>^M
      <element name="PONumber" type="sg:ReferenceNumber" minOccurs="0"/>^M
      <element name="POItemNumber" type="wvd:A154_REF_NO" minOccurs="0"/>^M
      <element name="Quantity" type="sg:QuantityC" minOccurs="0"/>^M
      <element name="PackingQuantity" type="sg:QuantityC" minOccurs="0"/>^M
      <element name="ContainerNumber" type="sg:ContainerInfo" minOccurs="0"/>^M
      <element name="InvoiceNumber" type="sg:ReferenceNumber" minOccurs="0"/>^M
      </sequence>^M
      </complexType>^M
      </element>^M
      </sequence>^M
      </complexType>^M
      .....

      Attachments

        Activity

          People

            Unassigned Unassigned
            yighu yiguang hu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: