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

Re: pretty-printing XML

Subject: Re: pretty-printing XML
From: "Randy Oxentenko" <randy@xxxxxxxxxxxxx>
Date: Wed, 26 Mar 2003 12:36:49 -0600
emacs pretty print xml
I like the way this stylesheet works under Saxon.  It doesn't do much for me
with other XSL processors such as Xalan and msxsl, though.  I don't know
what it would do with your XML comments.  I suspect this may fall into your
long list of stylesheets that don't do the job.  It has the one advantage of
being simple.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
<xsl:output encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="*">
   <xsl:copy-of select="."/>

Randy Oxentenko

----- Original Message -----
From: "Lars Huttar" <lars_huttar@xxxxxxx>
To: "XSL-List (E-mail)" <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, March 26, 2003 12:06 PM
Subject:  pretty-printing XML

> Dear XSL users,
> I'm looking for a way to nicely print out my XML data.
> I've looked at a few XSL stylesheets that claim to pretty-print XML,
> but they don't seem to do what I want.  In particular, my XML has
> lots of very long comment lines, which I would like to be wrapped
> to a sensible line length, and indented with a hanging indent like this:
>   <!-- blah blah
>     blah blah
>     blah blah -->
> I've tried using Emacs XML modes to wrap them using sgml-fill-element;
> I've tried the Physiome Languages XML Pretty Printer, the DecisionSoft
> online pretty printer, and others.
> The latter indents comments well but starts them all at the left margin,
> no matter how deeply they're nested.  It also breaks the line whenever
> the comment mentions an <element> and goes back to the left margin.
> The former doesn't seem to indent elements based on their nesting depth.
> Mark Brown and Jeni Tennison's XML tree pretty printer is useful, but
> displays the tree rather than the XML text itself.
> "Tidy" doesn't seem to wrap long lines when it should.
> What I have had success with is using XMLSpy to print the XML, which
> puts it in sort of a table view.  However my trial period for XMLSpy
> has expired.  I've decided I'm willing to purchase it, if only for
> printing, but I thought I'd ask you folks first.
> What do you use for printing out your XML data, so you can look at it
> offline?  A stylesheet?  Other free software?
> Thanks,
> Lars
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
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.