Did you set the indentation settings in the writer?

Best regards: Zoltán Ördögh


On Tue, Apr 23, 2013 at 12:56 PM, <[email protected]> wrote:

> Hi,
>
> I wonder if there is a way to pretty print xml.
> Referring to the examples for xmlWriter I want
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <EXAMPLE><!--This is a comment with special chars: <äöü>--><ORDER
> version="1.0" xml:lang="de"><!--This is another comment with special chars:
> <äöü>--><HEADER><X_ORDER_ID>0000053535</X_ORDER_ID><CUSTOMER_ID>1010</CUSTOMER_ID><NAME_1>Müller</NAME_1><NAME_2>Jörg</NAME_2></HEADER><ENTRIES><ENTRY><ARTICLE>&lt;Test&gt;</ARTICLE><ENTRY_NO>10</ENTRY_NO></ENTRY><ENTRY><ARTICLE>&lt;Test
> 2&gt;</ARTICLE><ENTRY_NO>20</ENTRY_NO></ENTRY></ENTRIES><FOOTER><TEXT>This
> is a text.</TEXT></FOOTER></ORDER></EXAMPLE>
>
> to look like:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <EXAMPLE>
>   <!--This is a comment with special chars: <äöü>-->
>   <ORDER version="1.0" xml:lang="de">
>     <!--This is another comment with special chars: <äöü>-->
>     <HEADER>
>       <X_ORDER_ID>0000053535</X_ORDER_ID>
>       <CUSTOMER_ID>1010</CUSTOMER_ID>
>       <NAME_1>Müller</NAME_1>
>       <NAME_2>Jörg</NAME_2>
>     </HEADER>
>     <ENTRIES>
>       <ENTRY>
>         <ARTICLE>&lt;Test&gt;</ARTICLE>
>         <ENTRY_NO>10</ENTRY_NO>
>       </ENTRY>
>       <ENTRY>
>         <ARTICLE>&lt;Test 2&gt;</ARTICLE>
>         <ENTRY_NO>20</ENTRY_NO>
>       </ENTRY>
>     </ENTRIES>
>     <FOOTER>
>       <TEXT>This is a text.</TEXT>
>     </FOOTER>
> </ORDER>
> </EXAMPLE>
>
>
>
> _______________________________________________
> xml mailing list, project page  http://xmlsoft.org/
> [email protected]
> https://mail.gnome.org/mailman/listinfo/xml
>
>
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
https://mail.gnome.org/mailman/listinfo/xml

Reply via email to