OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Line Breaks and formatting

[ Lists Home | Date Index | Thread Index ]

[Karl Stubsjoen]
> I'm using vb and the MSXML2 object model to create XML documents in code.
> I've noticed that the XML is constructed all on one line... I'd like to
> somehow insert line breaks (and possibly add other formating like tabs),
> into my XML while creating with MSXML2.  Is this possible?

Not without writing a bunch of custom code.  You are really talking about
pretty-printing, right?  Most processing systems provide some kind of
prettyprinting, but not that would do everything you ask for.  That is a job
for either a special serializer or for some post-processing after the
serializer emits the xml.

To put it another way, prettyprinters usually do not wrap lines, so you
would have to add that ability or do it in postprocessing.

Of course, if your xml is simple and you know where line breaks should go,
you may be able to insert them into element character data as you create it,
before putting it into an element.  If you use attributes to hold the text,
you have to expect your line feeds and tabs to get normalized away.

Cheers,

Tom P






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS