Skip to content
Advertisement

How to get the attribute value of an xml node using java

I have an xml which looks like this:

JavaScript

Here I want to retrieve the value of “source type” where type is an attribute.

I tried the following, which didn’t work:

JavaScript

This also didn’t work:

JavaScript

Advertisement

Answer

Since your question is more generic so try to implement it with XML Parsers available in Java .If you need it in specific to parsers, update your code here what you have tried yet

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