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

XML Validation against Schema

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • 2.5.0, 2.6.2
    • None
    • None
    • Windows XP SP1
      JDK Sun 1.4.2_01
      Eclipse 3.0

    Description

      I implemented a class to validate an XML messagge against W3C Schema.
      I used a validation technique suggested in Sun tutorial on JAXP.
      To test it, I wrote a simple SOAP message and I run validation against SOAP1.1 Schema (downloaded from w3c):

      <SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client.001</faultcode><faultstring>errore prova</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

      Using Xerces (2.6.2 and 2.5.0) it fails with this issue:
      "Attribute 'encodingStyle' is not allowed to appear in element 'SOAP-ENV:Envelope' "

      The same message is validating fine using Oracle 10 XML parser (JAXP 1.2 compliant).
      The test message was previously validated fine with Oracle Parser 9x (using a different validation implementation, based on specific Oracle XDK objects).

      The Envelope type in SOAP Schema is:

      <!-- Envelope, header and body -->
      <xs:element name="Envelope" type="tns:Envelope" />
      <xs:complexType name="Envelope" >
      <xs:sequence>
      <xs:element ref="tns:Header" minOccurs="0" />
      <xs:element ref="tns:Body" minOccurs="1" />
      <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
      </xs:sequence>
      <xs:anyAttribute namespace="##other" processContents="lax" />
      </xs:complexType>

      If I'm able to read correctly this, it seem that in Envelope I can add any attribute which not belong to same namespace of Envelope element.
      And "encodingStyle" non qualified in my example don't belong to same namespace.

      I hope this could be enough.
      If you need my implementation and schema file I used, let me know.

      Thanks

      Giovanni Grimoldi

      Attachments

        Activity

          People

            Unassigned Unassigned
            ggrimoldi Giovanni Grimoldi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: