469,306 Members | 1,850 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

custom xml pretty print

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.

Nov 22 '05 #1
2 2147
akbar wrote:
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
Nov 22 '05 #2
akbar wrote:
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
Nov 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by r6uji7 | last post: by
3 posts views Thread by Shane | last post: by
1 post views Thread by Tim | last post: by
reply views Thread by akbar | last post: by
1 post views Thread by Anne DeBlois | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.