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 2001/07/09 10:21:51 UTC
[Bug 2510] New: - traverseImport does not use parsers EntityResolver
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2510
*** shadow/2510 Mon Jul 9 01:21:51 2001
--- shadow/2510.tmp.7688 Mon Jul 9 01:21:51 2001
***************
*** 0 ****
--- 1,56 ----
+ +============================================================================+
+ | traverseImport does not use parsers EntityResolver |
+ +----------------------------------------------------------------------------+
+ | Bug #: 2510 Product: Xerces-J |
+ | Status: NEW Version: 1.2.3 |
+ | Resolution: Platform: All |
+ | Severity: Major OS/Version: Other |
+ | Priority: Other Component: Schema-Structures |
+ +----------------------------------------------------------------------------+
+ | Assigned To: xerces-j-dev@xml.apache.org |
+ | Reported By: Bernd.Eilers@Germany.Sun.COM |
+ | CC list: Cc: |
+ +----------------------------------------------------------------------------+
+ | URL: |
+ +============================================================================+
+ | DESCRIPTION |
+ The traverseImport(Element importDecl) method in
+ org/apache/xerces/validators/schema/TraverseSchema.java uses it�s own
+ EntityResolver and does not utilize the EntityResolver set at the Parser.
+
+ The method should first consult the EntityResolver set at the parser and only
+ if that does not return an InputSource try to use it�s own EntityResolver.
+
+ To reproduce an Error:
+
+ Use a simple extension of org.apache.apache.xerces.readers.XMLCatalogHandler as
+ an EntityResolver at your parser. At the XMLCatalogHandler add a mapping for
+ the following system identifiers to a private internal URI scheme.
+
+ myCatalog.addSystemMapping
+ ("http://www.w3.org/2001/xml.xsd","org.apache.java.resource:/org/apache/test/xml
+ .xsd");
+
+ parser.setEntityResolver(myCatalog);
+
+ xmlReader.setProperty("http://apache.org/xml/properties/schema/external-
+ schemaLocation","http://www.w3.org/2001/XMLSchema
+ org.apache.java.resource:/org/apache/test/XMLSchema.xsd");
+
+ The resolveEntity method of the XMLCatalog should be able to load resource from
+ the java classpath via this private URI scheme. Add XMLSchema.xsd,
+ XMLSchema.dtd, datatypes.dtd and xml.xsd from W3C to the org.apache.test
+ package.
+
+ Enable schema validating and namespaces at the parser and try to validate eg.
+ personal-schema.xml or personal.xsd.
+
+ The following happens:
+
+ The XMLCatalog/EntityResolver is called for XMLSchema.xsd, XMLSchema.dtd,
+ datatypes.dtd and xml.xsd.
+
+ Than the ErrorHandler set at the parser will report an Error that it could not
+ find org.apache.java.resource:/org/apache/test/XMLSchema.dtd and an Exception
+ caused by traverseImport(Element importDecl) not calling the parsers
+ EntityResolver is thrown.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org