Thanks for the info, Neil. But I' not sure how to go forward from here.
>What I bet is happening is that
>there *is* a grammar in your grammar pool, but there's only one and it's
>not the one your document wants.
Imports aren't involved in this case (it's the trivial "personnel" example that ships with Xerces as a sample of schema use), and I'm loading the same file that the sample document specified via xsi:noNamespaceSchemaLocation. This Should Be Working, right?
>If you don't want to use the schema component API
I'd be glad to. I don't know how to; as you've agreed, there really isn't a cookbook for components and configurations yet, and reverse-engineering existing code convinces me that there are interactions I really don't understand yet. Which is why I'm looking for guidance...! <grin/>
>set the grammar pool you've created as a property on the
>XMLSchemaLoader instance.
I'll try that. Same GRAMMAR_POOL property name, I assume? Seems a bit odd that I have to both bind them this way _and_ explicitly put the loaded grammar into the pool... or does this make the latter step unnecessary?
The capsule summary of what I'm trying to code: I need a mechanism which validates one or more documents or document fragment(s), on demand, against an previously/separately loaded schema (which may be multiple schema documents). I've apparently got the first part of that working (though I'm not convinced my code is really right) based on Elena's DOM revalidator. I'm currently arguing with the latter.
One other complication is that I may need to be able to validate a fragment as if in the context of a specific set of ancestor elements. My current kluge is to generate those into the XNI stream, then strip them out of the returned data (using my own XNI Annotation, actually, to flag the ones which need to be discarded). Obviously I'd rather just tell the validator what context to start from, but I don't think that's possible yet.
Another complication: There's some argument about whether xsi:type and xsi:schemaLocation directives in the fragment should be honored (long story, still being argued, don't ask). I presume there's no way to tell the schema validator to ignore them and use only the preloaded grammars, and I'm honestly not sure whether there should be. So I may wind up having to do some magic to bypass these -- change their namespace for the duration of validation and change it back, or pass them through as annotations (and convert back on the far side) rather than normal XNI attributes.
So, yeah, I'm pushing the edge of what you've designed and I'm not surprised to find it confusing, nor would I be shocked to find I've exposed a bug. On the other hand, I've got folks who want this kluge running ASAP, so any guidance you can give me (or any assistance I can give you in analysing any glitches that arise) would be a Good Thing.
And in the process, we may be helping others understand a bit more about how to use XNI...
______________________________________
Joe Kesselman / IBM Research
- Revalidation: progress, and some additional questions Joseph Kesselman
- Re: Revalidation: progress, and some additional ques... neilg
- Re: Revalidation: progress, and some additional ques... Joseph Kesselman
- Re: Revalidation: progress, and some additional ques... Joseph Kesselman
- Re: Revalidation: progress, and some additional ques... neilg
- Re: Revalidation: progress, and some additional ques... neilg
- Re: Revalidation: progress, and some additional ques... Joseph Kesselman
- Re: Revalidation: progress, and some additional ques... Joseph Kesselman
- Re: Revalidation: progress, and some additional ques... Joseph Kesselman
