Documentbuilder setvalidating false

If you don't want to add this external dependency then you can simply use the standard jdk libraries (which actually are built using xerces internally). * Just to note that top rated answer requires the use of xerces. String Reader; /** * Pretty-prints xml, supplied as a string. bug_id=6296446 but it is resolved now., (Note if an error occurs this will return the original text) package com.test; import

Writer; /** * Pretty-prints xml, supplied as a string.

SAXParse Exception; try { Document Builder Factory doc Builder Factory = Document Builder Instance(); Document Builder doc Builder = doc Builder Document Builder(); Document doc = doc Builder.parse (new File("c:\tmp\my.xml")); // normalize text representation Document Element().normalize(); println ("Root element of the doc is " Document Element()Node Name()); Node List list Of Books = Elements By Tag Name("book"); int total Books = list Of Length(); println("Total no of books : " total Books); for(int i=0; i Here is an example of processing xpath with vtd-xml...

Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation.

If you need help with a specific XPath expressions, you should probably ask it as separate questions (unless that was your question in the first place here - I understood your question to be how to use the API in Java).

Edit: (Response to comment): This XPath expression will get you the text of the first URL element under Power Builder: import

BTW XMLRequest Reader subclasses Reader, and simply overloads the 3 read() Reader methods to return -1 when the xml end tag is encountered.

You must have an account to comment. Please register or login here!