File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting tag names

 
Ervin Loh
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic