RE: Fetching between two elements

"Deepa Janamatti (RBEI/EMT2)" <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <5CA0E7F9F0E0024095892716B9F4C53C0736046887@SGPMBX01.APAC.bosch.com>
Hi,
 Sorry, change the below line to
Document doc = new SAXBuilder().build(new File("<xml file path>"));

-----Original Message-----
From: Deepa Janamatti (RBEI/EMT2)
Sent: Thursday, 3. April 2008 9:16 AM
To: '[email protected]'; [email protected]
Subject: RE: [jdom-interest] Fetching between two elements

Hi,

Document doc = new Document("<xml file path>");
Element root = doc.getRootElement();
//write logic to fetch the "four" tag
Element fourEle;
fourEle.getParent().getChild("two");

Regards,
Deepa

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of [email protected]
Sent: Wednesday, 2. April 2008 10:31 PM
To: [email protected]
Subject: [jdom-interest] Fetching between two elements

Hi,

I want to parse between two elements. For example:

<root>
<one>1</one>
<two>2</two>
<three>3</three>
<four>4</four>
<five>5</five>
</root>

How can I fetch from 2(<two>2</two>) through 4(<four>4</four>) tag?

Thanks in advance.
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.