Access attribute values of empty element tag in xml
- by meenakshik
Hello,
I have a xml where I got some empty complex elements and I need to access the attribute values of this element.
<test>
<a>
<abc-metadata name="testData" value="This is a test"/>
</a>
</test>
I want to get hold of the 'testData' and 'This is a test' values.
I do read the document and I tried accessing it document.getElementsByTagName . I am sure there is some way to access attributes of element tags but somehow it throws me nullpointer exception.
Thanks in advance