RE: one line of xml to indented xml doc
Well, the end result is to have the document be human readable for easy editing, in any editor. Thanks, Astor -----Original Message----- From: Thomas B. Passin To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Sent: 3/24/02 3:17 PM Subject: Re: one line of xml to indented xml doc [Astor Rivera] Thanks for the help, although I may not have explained what I really needed. You did point out some redundancy I found later that evening. What I was trying to transform is a single line of xml being output from a C++ app, I must then take it and make it a well formed document with a hierachical structure and the transform is being done using MSXSL. It must remain generic as the output tags will always vary. [Tom P] Maybe you don't have to indent it at all. If the xml is correctly structured as it comes from the C++ source, it will work fine with any ordinary xm processor. Therefore I assume that you want it indented so a person can read it more easily. It's not so easy to do good pretty printing of arbitrary xml, especially without adding whitespace (like line feeds and tabs) to the text in places. If your xslt processor isn't doing the job, there are a number of pretty-prining stylesheets out there, which do varying quality jobs. I did one myself, and I image Jeni and Mike Kay have their own. However, if you just want to look at the output once in a while, perhaps while you are developing your application, it might be easiest just to use HTML Tidy, which does a pretty nice job. It's part of a number of packages incuding Chami's HTML-Kit and XML Cooktop (both free Windows programs). Tidy can be configured to work with xml input instead of html, despite its name. Or you can view the xml with Internet Explorer, which does a nice job. If this is not what you want, it would be helpful if you explain what you want to accomplish by indenting your xml. Cheers, Tom P XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format