You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2003/01/13 13:59:26 UTC

DO NOT REPLY [Bug 16020] New: - Schema ordering is important when validating with JAXP

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16020>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16020

Schema ordering is important when validating with JAXP

           Summary: Schema ordering is important when validating with JAXP
           Product: Xerces2-J
           Version: 2.2.1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: JAXP
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: kevinj@develop.com


I have a validator utility that until today was adding schemas by calling
dbf.setAttribute("http://apache.org/xml/properties/schema/external-schemaLocation",
schemaLocs);

where schemalocs is a 'list' of uri/location pairs, and this all works fine.

I've just ported this to JAXP1.2 and I'm now calling 

dbf.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource",
schemaFileNames);

where schemaFileNames is an array of schema file locations (all local). This
works, but only for a given value of works!

I have a WSDL doc that I'm trying to validate, and I'm passing 6 schemas to the
validator. One of these schemas is mine, the others are 'standard' (wsdl.xsd,
soap-envelope.xsd etc) expect that the soap-envelope.xsd has been tweaked so
that it contains an attribute group for the encodingStyle attribute. This tweak
is there so that I can add a reference to that attribute to my schema.

When using JAXP 1.2, if I pass the schemas in this order

..\schema\soap-encoding.xsd
..\schema\wsdl.xsd
..\schema\wsdl-soap.xsd
..\schema\soap-envelope.xsd
..\schema\XMLSchema.xsd
..\schema\bookOperations.xsd (this is my schema with the forward ref.)

then everything validates OK.

However if I pass them in this order
..\schema\bookOperations.xsd
..\schema\soap-encoding.xsd
..\schema\wsdl.xsd
..\schema\wsdl-soap.xsd
..\schema\soap-envelope.xsd
..\schema\XMLSchema.xsd

then the parse fails: I get 

error: org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name
'soap:encodingStyle' to a(n) attribute group component.
SystemId:
file:///D:/home/kevinj/Course/Terra/gjws/content/activities/ejws/wsdl/work/solutions/schema/bookOperations.xsd
Column: 51
Line: 28

It looks like there is a forward ref from bookoperations.xsd to
soap-envelope.xsd if I pass the schemas in this order through JAXP1.2

As I said, if I use the
dbf.setAttribute("http://apache.org/xml/properties/schema/external-schemaLocation",
schemaLocs); call then the order doesn't matter and things work fine.

Kevin Jones
Developmentor

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org