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
BEGIN:VCARD
VERSION:2.1
N:Hubert;Cory;L
FN:Cory L Hubert
ORG:Invertica;Engineering
TITLE:Senior Software Engineer
TEL;WORK;VOICE:646-792-6588
TEL;WORK;FAX:212-571-3588
ADR;WORK:;;59 John Street 3rd Floor;New York;NY;10038;USA
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:59 John Street 3rd Floor=0D=0ANew York, NY 10038=0D=0AUSA
URL:
URL:http://www.invertica.com
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20010124T195702Z
END:VCARD