[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] XML pretty printer


Subject: Re: [xsl] XML pretty printer
From: John Christopher <john.christopher1100@xxxxxxxxx>
Date: Tue, 27 Sep 2011 04:39:44 -0700 (PDT)

Dear Liam,

Thank you for replying.  My comments are at
the bottom.

----- On Mon, 2011-09-26, I wrote:

> I am looking for a stylesheet (or free software
> that runs from the command line on linux) that
> will take the following input:
[...]

> and pretty prints it like this (each attribute
> printed on a separate line beneath the element
> and indented):


----- You were kind enough to reply:

> what should it do with

> <paragraph breakable="no">This is a <emphasis>short</emphasis>
> paragraph as an <italic>ex</italic>ample.</paragaph>
> ?

> What about
> <script type="text/javascript">
> var i; // loop variable
> i = 3; // assignment
> alert("i is " + i); // coercion
> </script>
> ?


My data only contains elements with attributes
and no CDATA or PCDATA.

If my data *did* contain CDATA or PCDATA, the
formatter should leave the data alone, but
properly indent the surrounding tags.


Current Thread