have got this so far, but its only reading b name="test0" and not its child nodes. i basically want to parse the entire file and obtain individual element attributes.
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document
doc = docBuilder.parse (new File("settings.xml"));
doc.getDocumentElement ().normalize ();
Node n;
NodeList nodes = doc.getDocumentElement().getChildNodes();
for( int i=0 ; i<nodes.getLength(); i++ )
{
n = nodes.item( i );
if( n.getNodeType() == Node.ELEMENT_NODE )
{
if( n.getNodeName().equals( "b" ) )
{
NamedNodeMap attrs = n.getAttributes();
String x = attrs.getNamedItem("name").getNodeValue();
String y = attrs.getNamedItem("value").getNodeValue();
}
}
else
{
}
}>