Two Laptop Bag*
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 Android Security Essentials Live Lessons this week in the Android 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.
 
wood burning stoves
 
subject: getting tag names
 
Similar Threads
Indexed Properties Example
Methods and Objects
MOCK QUESTIONS !!
mock question
How to retrieve reqd. tag values