Has anyone seen code that will pretty print my XML? Something with less over-head than a real parser? Thanks.
Please ignore post, I have no idea what I am talking about.
author and deputy
Joined: Jul 13, 2001
Hi, One of the IBM DOM tutorial says that System.out.println(root.toString()); will print the XML in a non-normalized way,its also say that you may not see the output pretty printed due to version conflict,you can give a try with ur java version.
That tutorial was very helpful. But the print out is giving me [<the doc root>: null] which isn't even ugly. A note on one of the pages says: "If the application does not print out the structure of the root element, check the CLASSPATH. The JAXP jar files must appear first if other XML implementations are also present. If you are using Java 2 SDK version 1.4, the output may look "pretty printed"." I am not running 1.4, do you know what they mean by JAXP? My code:
Related thread I tried lots of different solutions, not all of them I am sure, but I ended up writing my own. It is a basic state engine, no tree or anything like that. It handles attributes and subscripts.
[ October 08, 2002: Message edited by: William Barnes ] [ October 08, 2002: Message edited by: William Barnes ]