the value of an Element ist stored in an child-node of the Element.
System.out.println(docElement.getChildNodes().item(i).getFirstChild().getNod
eValue());
should work
-----Original Message-----
From: Cory Hubert [mailto:[EMAIL PROTECTED]
Sent: Dienstag, 20. Februar 2001 18:35
To: [EMAIL PROTECTED]
Subject: Problem with DOMParser
Hello. I am having some issues using the DOMParser. I read the
Documentation. And I believe I am doing everything correctly. The following
code reads in the xmlResponse.xml document correctly, you can even get the
name of the Nodes within the document. BUT you can't retrieve thier values.
Any Idea what could be the issue?
DOMParser p = new DOMParser();
InputSource source = new
InputSource("xmlResponse.xml");
p.parse(source);
Document doc = p.getDocument();
Element docElement = doc.getDocumentElement();
for (int i =0; i <
docElement.getChildNodes().getLength(); i++)
{
System.out.println(docElement.getChildNodes().item(i).getNodeName());
System.out.println(docElement.getChildNodes().item(i).getNodeValue());
}
Invertica
:Cory L Hubert
:Senior Software Engineer
:[p]646-792-6588
:[f]212-571-3588