You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Vl...@bmo.com on 2001/07/23 17:43:57 UTC

Format control in XMLSerializer

Hi all,

I have a question about DOMGenerate Xerces example:

Is there a way to make XML serializer produce output:
STRXML = <person>
<name>Jeff</name>
<age>28</age>
<height>1.80</height>
</person>


I'm using DOMGenerate example and if I set indent=0 it puts all the output
in one line:

          format.setOmitXMLDeclaration(true);
          format.setIndenting(true);
          format.setIndent(0);

STRXML
= <person><name>Jeff</name><age>28</age><height>1.80</height></person>

Any help is appreciated.

Vlad



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org


RE: Format control in XMLSerializer

Posted by Swarajit Ray <sw...@horizoncompanies.com>.
use the following 
format.setIndenting(true) ;
format.setIndent(4) ;

-----Original Message-----
From: Vlad.Epshtein@bmo.com [mailto:Vlad.Epshtein@bmo.com]
Sent: Monday, July 23, 2001 11:44 AM
To: xerces-j-dev@xml.apache.org
Subject: Format control in XMLSerializer



Hi all,

I have a question about DOMGenerate Xerces example:

Is there a way to make XML serializer produce output:
STRXML = <person>
<name>Jeff</name>
<age>28</age>
<height>1.80</height>
</person>


I'm using DOMGenerate example and if I set indent=0 it puts all the output
in one line:

          format.setOmitXMLDeclaration(true);
          format.setIndenting(true);
          format.setIndent(0);

STRXML
= <person><name>Jeff</name><age>28</age><height>1.80</height></person>

Any help is appreciated.

Vlad



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org