K
kumsa
hi iam new to java and jdom parsing.my imput is user passes the xml
file and a string (string is not a tag in xml its a attribute value).i
need to look for the string in the xml file and get all its child
attributes .my xml looks like
<Trs>
<cetTra>
<xName>"jeff"</xName>
<child>pat</child>
<child>sush</child>
<Delay>
<timeSec>60</timeSec>
<retry>1</retry>
</Delay>
</cetTra>
<cetTra>
<xName>"kumsa"</xName>
<child>sac</child>
<child>ed</child>
<Delay>
<timeSec>5</timeSec>
<retry>10</retry>
</Delay>
</cetTra>
</Trs>
my quesion is how to get only the the contents based on attribute
..Input string will be jeff i need to get the contents only for jeff .my
code looks like
List passedStringList = root.getChildren("CetTra");
Iterator i = passedStringList.iterator();
while (i.hasNext()) {
Element serv= (Element) i.next();
out.print("\t" + serv.getChild("xName")
.getText());
or can i do this with Jdom or shld i use perl parser .Can any one pls
guide me how to proceed.
thanks in advance
file and a string (string is not a tag in xml its a attribute value).i
need to look for the string in the xml file and get all its child
attributes .my xml looks like
<Trs>
<cetTra>
<xName>"jeff"</xName>
<child>pat</child>
<child>sush</child>
<Delay>
<timeSec>60</timeSec>
<retry>1</retry>
</Delay>
</cetTra>
<cetTra>
<xName>"kumsa"</xName>
<child>sac</child>
<child>ed</child>
<Delay>
<timeSec>5</timeSec>
<retry>10</retry>
</Delay>
</cetTra>
</Trs>
my quesion is how to get only the the contents based on attribute
..Input string will be jeff i need to get the contents only for jeff .my
code looks like
List passedStringList = root.getChildren("CetTra");
Iterator i = passedStringList.iterator();
while (i.hasNext()) {
Element serv= (Element) i.next();
out.print("\t" + serv.getChild("xName")
.getText());
or can i do this with Jdom or shld i use perl parser .Can any one pls
guide me how to proceed.
thanks in advance