|
|
Log in / Subscribe / Register

XSLT as Pretty Printer (XML.com)

Hew Wolff uses XSLT for print formatting on O'Reilly's XML.com. "Recently I was wading through some hard-to-read XML files. Art & Logic, the company I work for, was helping a client to build an Ajax-style Web interface that used XML to talk to the backend and client-side XSLT to produce the HTML. I found myself reformatting the XML by hand to make things easier and finally wondering as I hit the spacebar yet again: couldn't an XSLT style sheet do this formatting for me? I had done something similar before, so I decided to try writing that style sheet, using a test-driven approach. Some hours later I had a handy utility, and a new appreciation for some of the wrinkles of XML. Here's a cleaned-up account of what I did."

to post comments

Misleading article description

Posted Dec 7, 2006 14:07 UTC (Thu) by jschrod (subscriber, #1646) [Link]

This article is not about print formatting, but about pretty-printing XML, i.e., adding `good' indentation and newlines to XML documents.

It's actually also a hands-on introduction in very simple XML->XML transformation with XSLT; since the indentation solution is not very flexible and would need lots of adaption to many other situations.

Cheers, Joachim


Copyright © 2006, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds