David Bertoni wrote:
>
>
> You can easily keep a list of the namespace bindings in your instance
> document, as they are declared. Isn't that enough, or do you need to
> know all of the namespaces in the schema, regardless of whether or not
> they appear in the instance document? For that, you could parse the
> schema documents using the the SAX parser, and determine the target
> namespace for each schema.
>
> It would help if you provided more details of the GrammarResolver member
> functions you want to use, or described the problem you're trying to
> solve in more detail.
>
> Dave
>
>
This is a bit of long story but shortened here goes. We used to use
Xerces2.6 and the developers in their wisdom decided to add in additional
functionality and calls when they couldnt do what they wanted to. At that
time they were not experienced cpp programmers and didnt even know how to
cast pointers. Well, I have upgraded to Xerces3.0 and reworked their code so
that the Xerces base is pristine and will remain that way! The original
code went something like:
RefHashTableOfEnumerator<Grammar> grammarEnum =
pParser->getGrammarEnumerator();
while (grammarEnum.hasMoreElements())
{
SchemaGrammar& sGrammar = (SchemaGrammar&) grammarEnum.nextElement();
if (sGrammar.getGrammarType() != Grammar::SchemaGrammarType)
continue;
RefHash3KeysIdPoolEnumerator<SchemaElementDecl> schemaElemEnum =
grammar->getElemEnumerator();
while(schemaElemEnum.hasMoreElements()) {
...
}
}
This was used to build up a flat structure of the schema and then make a
tree out of it all <scratches head> They should have used the XSModel I know
but this is legacy code and I have to interface into it quickly.
All I really need is to gain access to the fGrammarResolver member variable,
I believe from there I can then get a list of namespaces and use
getGrammer(chNamespace), so that I can continue to read in the elements.
The SAX2XMLReaderImpl gives access to various structures, but the grammar
resolver seems to have been left out. Im not sure if this an omission or it
has been done on purpose. ideally I need:
inline GrammarResolver* SAX2XMLReaderImpl::getGrammarResolver() const
{
return fGrammerResolver ;
}
Is there another way to get access to the grammar resolver via different
methods or is the above function call really missing. If it is missing can
we get it added for future versions ?
Thanks for your help
Andrea
PS: Oh by the way, the roduct Manager is insisting this is working by the
end of the week so having to write and integrate masses of code is not
really an option :(
--
View this message in context:
http://www.nabble.com/Enumerating-multiple-namespaces-in-Xerces-3.00-tp25138875p25149676.html
Sent from the Xerces - C - Users mailing list archive at Nabble.com.