logo       

DO NOT REPLY [Bug 30481] New: - Order of schemas with .../schemaSource: msg#00003

text.xml.xerces-j.devel

Subject: DO NOT REPLY [Bug 30481] New: - Order of schemas with .../schemaSource

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

http://issues.apache.org/bugzilla/show_bug.cgi?id=30481

Order of schemas with .../schemaSource

Summary: Order of schemas with .../schemaSource
Product: Xerces2-J
Version: 2.6.2
Platform: PC
OS/Version: Other
Status: NEW
Severity: Major
Priority: Other
Component: JAXP
AssignedTo: xerces-j-dev@xxxxxxxxxxxxxx
ReportedBy: alonso@xxxxxxxxxxxxxx


Suppose you have schema1.xsd, that imports some elements from another namespace
defined in schema2.xsd.

Then, you have a file f1.xml, a valid instance of schema1.xml.

When I try to parse it with following code, I got an error:

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
factory.setValidating(true);
factory.setIgnoringElementContentWhitespace(false);
factory.setAttribute(
"http://java.sun.com/xml/jaxp/properties/schemaLanguage";,
"http://www.w3.org/2001/XMLSchema";);
factory.setAttribute(
"http://java.sun.com/xml/jaxp/properties/schemaSource";,
new File[] {
new File(path_to_schema1.xsd), // 1
new File(path_to_schema2.xsd), // 2
});
builder = factory.newDocumentBuilder();
org.w3c.dom.Document doc = builder.parse(path_to_f1.xml);

But, if I change lines 1 and 2:

new File(path_to_schema2.xsd), // 1
new File(path_to_schema1.xsd), // 2

Validates ok !

IMHO, this is not the expected behavior for the parser JSXP 1.2 compliant.

I can send you a example if you need it.
Thanls in advance.

Hector./


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise