You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Mengel Andre (FV/SLM) *" <An...@de.bosch.com> on 2001/04/27 13:26:02 UTC

How to determine Element-Type ?

Dear J-Parser-Experts,

I have a question refering to the Xerces Java 1 parser.
Is it possible to use this parser in order to determine the type of an
element
of an XML-Document ?
The XML-Document is schema based.
Is there any class or function to get this information ?
Thank you for your efforts and best regards,

Andre Mengel


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: How to determine Element-Type ?

Posted by René Jensen <lu...@tbkol.dk>.
Citat "Mengel Andre (FV/SLM) *" <An...@de.bosch.com>:

> Dear J-Parser-Experts,
> 
> I have a question refering to the Xerces Java 1 parser.
> Is it possible to use this parser in order to determine the type of an
> element
> of an XML-Document ?
> The XML-Document is schema based.
> Is there any class or function to get this information ?
> Thank you for your efforts and best regards,
> 
> Andre Mengel
> 

Yes, if you parse the document to a DOM using a DOMParser you can use the 
Node.getNodeType() on all nodes and compare the returned value with the 
staticlly defined values in Node to determine the type of the node.


       _\|/_
       (@ @)
---oOOo-(_)-oOOo---
    René Jensen
 lundeman@tbkol.dk

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org