[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Line Breaks and formatting


xml line breaks
[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



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.