Skip to content

Tag: java

get key value Pairs from XML file in Java

I have to get Key and values from XMl File, I am getting Key but not value XML File: Result Should be Like this : usb: 100, charger: 200 Answer The values 100 and 200 are in Textnodes. You can get the content with: laptopElement.getTextContent()