get TagName from xml dom tree

Put your problem here if it does not fit any of the other categories.

get TagName from xml dom tree

Postby bmaassen » Mon Dec 28, 2009 1:47 pm

Hi,

I'm trying to port some software i build to the android platform,
and for it i need to parse some xml.

I was happy to see that i had almost nothing to change...
until i run the program.

In java 1.6 you can use the following method to get the tag name of a node:
getNodeName

However in the android version this same method will give back a Dom code word
for the type of node it is. The only way i see i can get the tag name is in the Element node,
getTagName, however i can't cast to Element.

Is there still a way to retrieve the Tag name of the node?
bmaassen
Freshman
Freshman
 
Posts: 2
Joined: Mon Dec 28, 2009 1:37 pm

Top

Postby bmaassen » Mon Dec 28, 2009 2:20 pm

After some experimenting the problem is solved.

After adding document.getDocumentElement(), and start parsing from there all worked again.
bmaassen
Freshman
Freshman
 
Posts: 2
Joined: Mon Dec 28, 2009 1:37 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 14 guests