[jdom-interest] XMLOutputter PI and formatting problem...

John Pang jpang at viviance.com
Wed Aug 15 12:27:07 PDT 2001


>>>I've recently added some patches from Alex Chaffee to XMLOutputter... can
>>>you try this again now and see if there is a different result?

I've tried the new XMLOutputter, but I'm still having problems.

This is what my xml looks like before I do anything to it :

<para-text>Nehmen Sie zu den nat&uuml;rlichen Zahlen noch die Null und die
negativen Zahlen hinzu, so haben Sie die n&auml;chstkompliziertere
Zahlenklasse: die ganzen Zahlen.</para-text>


This is what it looks like after it comes out of the new XMLOutputter :

<para-text>Nehmen Sie zu den nat
  &uuml;
  rlichen Zahlen noch die Null und die negativen Zahlen hinzu, so haben Sie
die n
  &auml;
  chstkompliziertere Zahlenklasse: die ganzen Zahlen.
</para-text>


The output looks okay, but if the document goes through XMLOutputter again,
I get :

<para-text>Nehmen Sie zu den nat

  &uuml;

  rlichen Zahlen noch die Null und die negativen Zahlen hinzu, so haben Sie
die n

  &auml;

  chstkompliziertere Zahlenklasse: die ganzen Zahlen.

</para-text>


The problem is the introduction of line breaks for unexpanded entities, and
line breaks before the closing element tag. Everytime subsequent time I put
the document through XMLOutputter, I get an extra line break added (to the
one(s) which are already there)...

It would be really nice for me if the line breaks weren't introduced for
unexpanded entities and before the closing element tag.

I've been writing a patch, but it doesn't work too well! Maybe I'll submit
it if I can get it right... or somebody decides to fix this before I do :-)

Many thanks,
John Pang




More information about the jdom-interest mailing list