I am still using the deprecated LSSerializer  because the xalan serializer has issues with the pretty print.
But when I have simple elements with only space, the serializer produces empty elements. Is there a tweak to keep the spaces in this elements?

Sample xml:
<root><child1>text</child1><child2>   </child2></root>
I attached a simple test program, that you can just run to see the results:

Program started
Xerces serializer will be used
<?xml version="1.0" encoding="UTF-16"?>
<root>
    <child1>text</child1>
    <child2/>
</root>

Xalan serializer will be used
<?xml version="1.0" encoding="UTF-16"?><root>
   <child1>text</child1>
   <child2>   </child2>
</root>

Regards
Dick Deneer

Attachment: TestSerializer.java
Description: Binary data

Reply via email to