This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes getting tag names Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "getting tag names" Watch "getting tag names" New topic
Author

getting tag names

Ervin Loh
Greenhorn

Joined: Feb 15, 2002
Posts: 6
i have the following xml documents:
<Control>
<Item>
<EP>
<EPName>epname1</EPName>
<TASK>
<TASKKey>taskname1</TASKKey>
<ACTION>
<ACTIONName> TESTing </ACTIONName>
</ACTION>
</TASK>
<TASK>
<TASKKey>taskname2</TASKKey>
<ACTION>
<ACTIONName> TESTing2 </ACTIONName>
</ACTION>
<ACTION>
<ACTIONName> TESTing3 </ACTIONName>
</ACTION>
</TASK>
</EP>
<PO>
<POKEYS> sss </POKEYS>
<ORDERITEM>
<ITEMName> GOOD To Eat </ITEMName>
</ORDERITEM>
<ORDERITEM>
<ITEMName> GOOD To Eat </ITEMName>
</ORDERITEM>
</PO>
</Item>
<Item>
<EP>
<EPName>epname2</EPName>
<TASK>
<TASKKey>taskname1</TASKKey>
<ACTION>
<ACTIONName> TESTing11 </ACTIONName>
</ACTION>
<ACTION>
<ACTIONName> TESTing22 </ACTIONName>
</ACTION>
</TASK>
<TASK>
<TASKKey>taskname2</TASKKey>
<ACTION>
<ACTIONName> TESTing33 </ACTIONName>
</ACTION>
</TASK>
</EP>
<PO>
<POKEYS> sss </POKEYS>
<ORDERITEM>
<ITEMName> GOOD To Eat </ITEMName>
</ORDERITEM>
<ORDERITEM>
<ITEMName> GOOD To Eat </ITEMName>
</ORDERITEM>
</PO>
</Item>
</Control>
Is there a way to get the Tag name at a certain level without knowing its
name? Like the third level tag is 'EP' and we want to get the string 'EP'.
Or can we get a vector of tag names at the Third level.
Or can we get a vector of elements at the third level and then get the tag
names from the elements?
Also can we get an Element from another Element.
will appreciate if someone can show me some working codes.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getting tag names