MXXMLWriter for pretty printing

Andy Fish

Usenet Archive
Joined
Dec 30, 2002
Messages
605
Reaction score
0
Hi,

I am trying to use MXXMLWriter with the indent flag to pretty print an XML document from vb6.

Although the output is mostly indented in a reasonable way, the end tags are always bunched up at the end of a line not on a line by themselves e.g.

<a>
<b>
<c>some text</c/> </b>
<d>more text</d> </a>

am I doing something stupid here? is VB just displaying it in a funny way? is there any other way to fix this behavior?

failing that, does anyone know of a SIMPLE way of indenting some XML with vb and MSXML? by simple I mean less than 100 lines of code, no extra downloads and no horrible API calls.

I realise that XML and whitespace is an emotive issue. My definition of reformatting is that any whitespace within a text node (i.e. not at the beginning or the end) or between text nodes should be preserved. whitespace-only text nodes and leading/trailing whitespace should be rewritten to "pretty up" the document. I think this would serve for 95% of all 'pretty print' requirements.
 

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

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top