[jdom-interest] Fetching between two elements

Deepa Janamatti (RBEI/EMT2) Deepa.Janamatti at in.bosch.com
Wed Apr 2 20:45:53 PDT 2008


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: jdom-interest-bounces at jdom.org [mailto:jdom-interest-bounces at jdom.org] On Behalf Of deneme.true at gmail.com
Sent: Wednesday, 2. April 2008 10:31 PM
To: jdom-interest at jdom.org
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/youraddr@yourhost.com



More information about the jdom-interest mailing list