Hi Chaps,

I am having some problems with XMLGrammarPool and I would like to
confirm the cause of this.

I think that it is because I have a number of different XML documents
that use different XML Schemas, and these all use the same namespace
i.e. no namespace.

When I create a new XMLGrammarPool and validate document A with Schema 1
it works, however when I then validate document B with Schema 2 using
the same XMLGrammarPool it fails as it cant find the Schema. Both
document A and document B have no namespace defined.

e.g.

<a xsi:noNamespaceSchemaLocation="1.xsd"
xmlns:xsi="xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
...
</a>

<b xsi:noNamespaceSchemaLocation="2.xsd"
xmlns:xsi="xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
...
</b>


Our application needs to validate a number of different incoming XML
documents using their XML Schemas, a number of these documents all have
no namespace and use xsi:noNamespaceSchemaLocation="blah.xsd" to refer
to their Schemas.

I would like to use an XMLGrammarPool for caching Schemas to improve
performance of the system. I thought that by implementing my own
XMLGrammarPool I would be able to determine the uniqueness of an
XMLSchema by something other than its namespace, e.g. its location.
However this doesn't seem to be the case.

After some investigation with the debugger: at line 1373 of
XMLSchemaValidator in com.sun.org.apache.xerces.internal.impl.xs (Sun
JDK 1.6.0_06) I see this comment in reset(XMLComponentManager
componentManager) - 

// store the external schema locations. they are set when reset is
called,
// so any other schemaLocation declaration for the same namespace will
be
// effectively ignored. because we choose to take first location hint
// available for a particular namespace.



My question then is how and what do I need to do to get this working? Or
if it is currently possible, then what am I doing wrong?



Thanks


Adam Retter

Landmark Information Group Ltd
5-7 Abbey Court
Eagle Way
Sowton Industrial Estate
Exeter
Devon
EX2 7HY

t: +44(0)1392 685403
w: http://www.landmarkinfo.co.uk



Registered Office: 7 Abbey Court, Eagle Way, Sowton, Exeter, Devon, EX2 7HY
Registered Number 2892803 Registered in England and Wales 

This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 

The information contained in this e-mail is confidential and may be subject to 
legal privilege. If you are not the intended recipient, you must not use, copy, 
distribute or disclose the e-mail or any part of its contents or take any 
action in reliance on it. If you have received this e-mail in error, please 
e-mail the sender by replying to this message. All reasonable precautions have 
been taken to ensure no viruses are present in this e-mail. Landmark Information
Group Limited cannot accept responsibility for loss or damage arising from the 
use of this e-mail or attachments and recommend that you subject these to 
your virus checking procedures prior to use.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to