I Have a API for XML docs that returns:
<response> <status>OK</status> <date>2015-11-25T14:49:03.014+01:00</date> <page>1</page><pages>4</pages> <total>692</total> <size>200</size> <jobs> </jobs> </response> The jobs tag is an array that contains:
<job> <id>9496192</id> <title>3D Geometry Specialist, C</title> <deleted>false</deleted>... </job> I want to iterate over this XML and retrieve for each job its id The docuemt is made from a String by this parse:
public Document stringToDom(String xmlSource) throws SAXException, ParserConfigurationException, IOException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); return builder.parse(new InputSource(new StringReader(xmlSource))); } Thanks!
No comments:
Post a Comment