473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Xerces exception with entity resolver and nested XSDs

hi everyone

i am having a bad time with an entity resolver. my application uses a
resolver to locally-cache the nested schemas that the basic xsd
includes to a local directory. however i am getting an exception when
the parser tries to parse one of the included xsds which it has
downloaded, because (as far as i can tell from the stack trace) it is
trying but failing to handle other included xsds. the exception is
here:

java.lang.NullPointerException
at org.apache.xerces.validators.schema.TraverseSchema .traverseImport(TraverseSchema.java:1953)
at org.apache.xerces.validators.schema.TraverseSchema .traverseIncludedSchema(TraverseSchema.java:1227)
at org.apache.xerces.validators.schema.TraverseSchema .traverseInclude(TraverseSchema.java:1135)
<.. stuff omitted for brevity ..>

basically my xsds are all located on a remote server - i want to cache
them locally while i parse a series of docs. so i have a top level
schema which *imports *another schema with a namespace:

<xs:import namespace="http://w3.ibm.com/cc/rdf/v1"
schemaLocation="cc-rdf.xsd"/>

.... and this imported schema is downloaded. but i think the exception
occurs when the imported schema is parsed, and the parser sees this in
it:

<xs:schema targetNamespace="http://w3.ibm.com/cc/rdf/v1"
xmlns="http://w3.ibm.com/cc/rdf/v1"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:include schemaLocation="cc-rdf-documentTypes.xsd"/>
<xs:include schemaLocation="cc-rdf-industryTypes.xsd"/>
<xs:include schemaLocation="cc-rdf-languageTypes.xsd"/>
<xs:include schemaLocation="cc-rdf-countriesTypes.xsd"/>
<xs:include schemaLocation="cc-rdf-geographySimpleTypes.xsd"/>
<xs:include schemaLocation="cc-rdf-productTypes.xsd"/>

the entity resolver does not resolve and locally cache these files at
all, so i am guessing that it's in parsing cc-rdf.xsd that the
exception occurs. the first of these files has this as its header

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://w3.ibm.com/cc/rdf/v1"
xmlns="http://w3.ibm.com/cc/rdf/v1" elementFormDefault="qualified"
attributeFormDefault="unqualified">

am wondering if some mismatch in namespaces is causing this but am not
sure. i can see that other included xsds are downloaded and parsed
fine. it seems that it is only the imported schema that fails. anyone
got any experience with this problem?

peter
Jul 20 '05 #1
0 2224

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Steinar Bang | last post by:
Platform: Intel PII, debian sarge testing/unstable, Blackdown J2SDK 1.4.0.99beta-1, ant 1.5.3-1, libxerces2-java 2.4.0-1, libxalan-java 2.4.1-1 Is there a way to make the Xerces-J parser, used as...
0
by: BODIN | last post by:
I have an XML document, which is actually physically stored in 2 separated files. doc1.xml and doc2.xml I NEED a WAY FOR THIS SIMPLE NEED : XML file splitted into two physical files, and use...
0
by: Francesc Guim Bernat | last post by:
Dear colleagues, i'm getting in troubles using one XML library with Visual Studio .NET and Xerces with Xalan. (Xercer 2.4 and Xalan 1.7) When i execute the code i get the next run time error: ...
0
by: Soren Kuula | last post by:
Hi, I'm using a catalog for my Docbook xsl transformation. I can see (by having the resolver dump debug information) that the remapping of the system identifier <rewriteURI...
0
by: Dale Gerdemann | last post by:
I've been trying to use DOM level 3 with xerces-2_6_2. There's a sample called samples/DOM3.java, but I've had trouble with compilation. I've downloaded Xerces-J-bin.2.6.2 and...
2
by: Cigdem | last post by:
Hello, I am trying to parse the XML files that the user selects(XML files are on anoher OS400 system called "wkdis3"). But i am permenantly getting that error: Directory0: \\wkdis3\ROOT\home...
1
by: Francesc Guim Bernat | last post by:
Dear colleagues, i'm getting in troubles using one XML library with Visual Studio .NET and Xerces with Xalan. When i execute the code i get the next run time error: "Run-Time Check Failure #2...
2
by: delphin.lecucq | last post by:
Hello, I want to load a grammar which doesnt not come with a DOCTYPE declaration, I tried with those lines, and it doesn't work parser->setFeature(XMLUni::fgSAX2CoreValidation, true);...
0
by: punjabinezzie | last post by:
I am developing an Application which currently has two XML files. One XML file with some nodes and an external entity reference to another XML file. The source XML file is being parsed using Xerces...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.