Andrea009 wrote:
Hi,
I am using the Sax parser to read in XML which contains multiple namespaces.
How can I get access to the GrammarResolver so that I can access some of its
functions ?
In SAX2XMLReaderImpl::Initialise the member variable fGrammarResolver is set
up, and I can also see it when inspecting that class's member variables. But
alas, using the current interface Im unable to get access.
I am able to use getRootGrammar() but this only gets me the top level, I
dont get anything else. The only other way is to get the getGrammar(...) but
that requires the namespace to be passed in and I need a list so that I can
utilise that function. I cannot see way forwards.
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