[jdom-interest] XMLOutputter patch

Alex Rosen arosen at silverstream.com
Tue Nov 27 17:21:20 PST 2001


> I have Text node done for the code in the jdom branch. If I
> remember right
> though, didn't everyone want to add the changes for Text node
> to be in jdom-wip
> only and leave the jdom branch as is for now?

I have no opinion on this. Brett or Jason, is this still the desired plan?

> It goes something like this: currently
> with newline and
> normalization alot of energy is spent moving/converting
> characters back and
> forth, such as String->char[]->String, etc, etc.

Note however that StringBuffer->String is much cheaper than String->char[]
or char[]->String:
http://www.servlets.com/archive/servlet/ReadMsg?msgId=8775&listName=jdom-int
erest

> I guess anothor way to put this is view the whole document as
> a stream of
> char and all we need do is tell the writer (I guess filter would be a
> better term) when to turn on/off normalization, trimming,
> escaping, etc.
> and let it handle it (do as little preprocessing on our part
> as we can get away with).

Interesting idea. Seems a little counter-intuitive to me, though. Also, not
sure how it would help - each filter would still have to do a copy, right?
This might actually make things worse. The patch I sent in meant that the
escaper wouldn't have to do any allocation or copying, for an attribute that
had no special characters. But if the escaper is a filter, wouldn't it
*always* have to copy each character, if there were special characters
*anywhere* in the document?

Alex




More information about the jdom-interest mailing list