Hi people can you help me?
Well heres my problem. I am trying to parse an xml document via a uri.
i have the following code to parse the URI and get the document.
String uri = "http://someServer.com/Server/Database"
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse(uri);
The server just contains an XML document containing information on the
server.
However when i parse the document i dont think it parses correctly. Is
there a way to View the contents of the document object i have created
or is there a better way to parse the uri and get back a document?
Many thanks in advance
Andrew
opalpa@gmail.com opalinski from opalpaweb - 17 Mar 2006 00:56 GMT
To print the entire document to standard output:
DOMSource source = new DOMSource(document);
StreamResult stdout = new StreamResult(System.out);
TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer = tf.newTransformer();
transformer.transform(source, stdout);
Opalinski
opalpa@gmail.com
http://www.geocities.com/opalpaweb/
carlito@whitmore.fsnet.co.uk - 18 Mar 2006 16:08 GMT
Thankyou very much it worked