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

Re: Schema-aware pretty-printing

Subject: Re: Schema-aware pretty-printing
From: Graydon <graydon@xxxxxxxxx>
Date: Wed, 21 Dec 2011 22:25:27 -0500
Re:  Schema-aware pretty-printing
On Wed, Dec 21, 2011 at 09:48:59PM -0500, Murray McDonald scripsit:
> A web search seems to indicate that OXygen is capable of doing an
> intelligent pretty-print (the information I found is in the context of XHTML
> but I assume it's more generalized than that??), however, I can't really
> justify buying it just for that.

Oxygen's format-and-indent is fully general in as much you can tell
oXygen which arbitrary elements are preserve-space and in that the
contents of mixed-content elements gets left in an unindented state.

> If needs be, I can write an XSLT to parse a DTD, classify each element as
> "inline", "mixed", "block" or "empty" and then do an identity transform
> against my XML source files inserting line-breaks and leading tabbing as
> required.
> I am wondering if anyone else has any other suggestions for me?

I can't imagine doing any significant amount of XSLT programming
_without_ using oXygen; I also can't imagine that you won't get your
purchase price back in saved time _just with this problem_, never mind
the subsequent year.

The other solution is to not try to hand-edit the PIs in place;
presumably you can identify their location with very specific XPath, the
kind that has position numbers after every element down from the root,
and mechanically insert them via XSLT.  The one-template-per-path
approach plus copy-constructor has the virtues of extending nicely and
repeatability but also the fault of requiring you to identify all those
locations precisely.

-- Graydon

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.