You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by ja...@vianova.no on 2009/03/20 14:37:25 UTC
SAX parsing - how to know the current's element type according on the
schemas
Hi! this is my first message to the list.
I have a small problem
I'm writting a parser for GML 3.1. I have some done and working. But now I
would like to have a les static parser than the one I have now in order to
support features inside the grammar for those that I didn't write a
specific handler. As a result the new parser can read any kind of gml
type, even those that provide their own xsd. Now, in order to import the
data contained in the file to my object model I need to know which type
within the schema set is each of the elements that I'm reading. That is,
when startElement event happens I would like to know what's the element's
type for the qname I receive.
I have been looking for documentation. But I can't find it out!
I guess I have to retreive the grammar from the parser, and then ask the
grammar which is the elementId. Then, with the ID I can know what I need.
But, I found no way to get this up.
Does someone know how this operation is done normally (with a piece of
sample code, please)?
Any comments are more than welcome!
Thanks!