[XML-SIG] Pretty-printing DOM trees

Gabe Wachob gwachob@aimnet.com
Wed, 20 Jan 1999 21:57:06 -0800 (PST)

On Wed, 20 Jan 1999, A.M. Kuchling wrote:

> Should this be left as just a black-box function, or should it be
> implemented as a subclass of the writer.XmlWriter() class?  I suppose
> it depends on the envisioned application for this; if it's just to
> make output a little bit more readable for debugging purposes, then
> customizability isn't very important.  On the other hand, if people
> will want to do careful indenting of the output, indenting some tags
> and not others, then the XmlWriter solution is the way to go.
> My inclination is to the former view, but then, that's also easier for 
> me. :)  Thoughts?

My feeling is that most purposes of writing out a DOM tree (or tree
representation of an XML tree) will either be 1) for debugging purposes or
2) highly stylized, for a pariticular purpose (like an editor or

In other words, the prettyprint either has to be *really* flexible or not
very useful outside of debugging. How many applications print out XML

Even an XML source browser would want to add features like
highlighting/tagging, hiding/exposing branches, filtering, etc. Unless you
plan on including a lot of these features (or at least hooks for them), I
don't see any reason to do anything more than a black-box solution. (I
would like to see an HTML rendering like my black-box SAX-driven script i
posted earlier today).

Gabe Wachob - http://www.findlaw.com - http://www.aimnet.com/~gwachob
As of today, the U.S. Constitution has been in force for 76,914 days
When this message was sent, there were 29,815,374 seconds before Y2K