custom xml pretty print

A

akbar

Hi,

I have Document. If I print it like this:

print doc.toprettyxml(" ")

I will get this:
<a>
<b>
<c>
blablablabla
</c>
</b>
</a>

What do I have to do if I want to print it like this:
<a>
<b>
<c>blablablabla</c>
</b>
</a>

Thank you.
 
D

Diez B. Roggisch

akbar said:
Hi,

I have Document. If I print it like this:

print doc.toprettyxml(" ")

I will get this:
<a>
<b>
<c>
blablablabla
</c>
</b>
</a>

What do I have to do if I want to print it like this:
<a>
<b>
<c>blablablabla</c>
</b>
</a>

Use a SAX-Handler, parse it yourself and pretty-print your own. You
_could_ use DOM, but I don't think its needed here.

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top