[jdom-interest] Parsing an XML File

Tatu Saloranta cowtowncoder at yahoo.com
Mon Jul 31 14:36:33 PDT 2006

--- enis enis <enis_ch2001 at yahoo.fr> wrote:

> Hello everyone,
> I'm new to JDOM, and I need to parse an XML file
> like :
> <all>
> <element>
>       <el_dtd>okay</el_dtd>
>       <el_ont>
>          <prop>valeur</prop>
>          <cpt>classe</cpt>
>       </el_ont>
>   </element>
> </all>
> I knew how to get an element like <el_dtd>, but I
> want to know how to get an element like <prop>
> (child of the child of the root element).

Have you actually tried to read tutorials, google for
sample code or so? This is such a basic question that
you should be able to find the answer by yourself.

Further, if you do know how to get 'el_dtd' element,
you access 'prop' exactly the same way, just using
different context node. As a programmer, you should be
familiar with basic concepts of tree traversal; JDom
tree is just a domain-specific tree.

-+ Tatu +-

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the jdom-interest mailing list