Hi Alberto,

sorry for bothering you but.
Second part is clear:- yes I want to read the annotation of any element.

But I still have no idea how to get GrammarResolver.
Do we talk about different xerces versions? I'm using 2.7.0 and neither
XercesDOMParser nor DOMBuilderImpl allow access to getEntityResolver().

Thanks a lot for your help
Michael

> >Alberto Massari wrote:
> > >
> > > You could use parser->getGrammar("urn:my:namespace"), but you really
> > > need the GrammarResolver in order to get the uriId for a given
> > > namespace. You have to downcast the pointer to DOMBuilderImpl.
> > >
> >DOMBuilderImpl inherits protected getGrammarResolver() from baseclass
> >AbstractDOMParser. So I see no way to acces it. Neither by downcast.
> 
> Yes, you are right... as a partial excuse, I usually derive a class 
> >from XercesDOMParser when I need to access the Grammar; if you don't 
> really need the W3C interface you can do the same.
> 
> 
> So in general you want to read the annotation of any validated 
> element, without any previous knowledge of the schema used? In this 
> case you should build the list title->book->books by navigating the 
> DOM tree, then navigate downwards as I showed. Or navigate to the 
> parent, ask for the PSVI information, check it is not an anonymous 
> type, retrieve the global complex type with the name and ask for the 
> element with that enclosing scope. If the parent has an anonymous 
> type, go to the parent and try again.
> 
> Alberto
> 
> 

Reply via email to