  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Subject: Re: Getting the Sub-Elements of the JDom Tree | Subject: Re: Getting the Sub-Elements of the JDom Tree 2007-10-18 - By Mattias Jiderhamn
Back Have you tried reading the JavaDocs (http://jdom.org/docs/apidocs/index.html)? See for example http://jdom.org/docs/apidocs/org/jdom/Element.html#getChildren()
-- ----- Original Message -- ----- Subject: [jdom-interest] Getting the Sub-Elements of the JDom Tree From: Ramo At Skuff <ramo@(protected)> To: jdom-interest@(protected) Date: 2007-10-17 18:32 > Hi List, > > i have a Problem with getting step for step the subelements of this xml > file: > <Tab id="Kopfdaten" name="Kopfdaten"> > <Form> > <QuestionEntry no="1" structure="singelline"/> > <Question no="1">Zentrum</Question> > <FormElement type="sl" id="sl_01" > name="sl_01" mandat="y" value=""> > <option value="">sd</option> > <option value="">dd</option> > <option value="">fd</option> > <option value="">Sdr</option> > </FormElement> > > </Form> > </Tab> > > > > This code: > SAXBuilder sxbuild = new SAXBuilder(); > InputSource is = new InputSource(path); > Document doc = sxbuild.build(is); > > Element root = doc.getRootElement(); > > I''m getting the root element "Tab". I have the problem how to get the other > childelements? Say, that I get a result like this: > > Tab > Form > QuestionEntry > Question > Formelement > Option > Option > Option > Option > > > My aim is to parse that in HTML so that I get a matching with the xml > elements in a javaclass, so that I can transform it and write it in an html > file. > > > Kind regards > Ramo
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
|
|
 |