Boris Kolpackov-2 wrote:
>
> Hi Daniel,
>
> Sorry for the previous email -- hit send accidently.
>
> Daniel Jackson <[EMAIL PROTECTED]> writes:
>
>> So basically if I have schema A that includes schema B (both have the
>> same
>> namespace) and I create an in-memory schema that includes both of them
>> and
>> has the same namespace, I could use loadGrammar to load all 3 and then
>> the
>> XML file should pass validation. Is this correct?
>
> Yes, if the XML file conforms to the vocabulary defined by A and B.
>
I tried this and noticed something. When loading the in-memory schema I get
2 calls to resolveEntity trying to resolve the 2 includes, therefore I don't
really need to call loadGrammar for schemas A and B right?
Boris Kolpackov-2 wrote:
>
>
>> I want to handle the resolving of entities during the validation
>> (here resolveEntity comes along) and if I try loading using
>> loadGrammar it simply tries on it's own. Maybe there's a way to
>> make loadGrammar call resolveEntity when it parses the grammar?
>
> I would expect it to. Can you make sure that you set your entity
> resolver before you call loadGrammar?
>
> Boris
>
You are correct, I set the entity resolver after calling loadGrammar.
Going abit off-topic I have a general question about the XML parsing
objects.
I wish to reuse the parsing object itself (say XercesDOMParser) -- meaning I
don't want to keep creating a new one and call loadGrammar repeatedly since
the loading of schemas in my program takes quite a while. Can the parser
object handle multiple calls to parser.parse()... from different threads? If
it is what will happen if in thread A I call parser.parse() and in thread B
I'll call parser.loadGrammar?
And one last thing, I tried validating a XML file taken from a .docx zip
file (document.xml) with the schemas provided by Microsoft (there are a few
dozens) and I get alot of errors while calling loadGrammar to load the
schemas needed for that XML file saying element X cannot be found etc. Does
this make sense? I tred validating the same XML using XML Spy or MSXML and
it works fine.
Thanks alot.
--
View this message in context:
http://www.nabble.com/setExternalSchemaLocation-and-xs%3Aimport-tp15532404p15824173.html
Sent from the Xerces - C - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]