Link to home
Start Free TrialLog in
Avatar of DJ_AM_Juicebox
DJ_AM_Juicebox

asked on

Getting XML element's name

Hi,

Getting a node like this:

    // Get child node.
    Node childNode = list.item(i);

How do you get the name of the element? For example:

    <furniture>chair</furniture>

I want to get the element name 'furniture'.

Thanks
Avatar of Mick Barry
Mick Barry
Flag of Australia image

String name = childNode.getNodeName();
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial