Skip to content
Advertisement

getAttributeValue returns null java

i want to get the vaule of type in root element.

if i try with getAttributeValue(“type”) it returns null value

here the sample xml and code. i’m using org.jdom2.Element for parsing help will be appriciated.

Sample xml

JavaScript

my code

JavaScript

Advertisement

Answer

Perhaps you have bad imports. Your code works for me.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement