XSL and Device-Independent Formatting

David Megginson david at megginson.com
Thu Sep 10 19:35:24 BST 1998

Andrew Bunner writes:

 >   The moral of the story is that if your target language is not
 > XML, then you have to write your own tool to take it from XML to,
 > let's say, HTML.  One way is to get into the XSL processor and add
 > your own code, another (less clean) way is to write something that
 > post-processes the XML representation of the target language.

<warning>I have not had the opportunity to spend much time with the
 new XSL WD yet, so my answer is based on general practice rather than
 the specific process defined in the XSL WD.</warning>

I think that people are over-thinking the problem.  Try this on for
size: an XSL formatter produces a device-independent formatting tree,
then can render the same tree in different concrete formats (PDF, PS,
DVI, or what have you).  As a happy co-incidence, it happens that the
intermediate formatting tree -- like most structured information --
can be serialised as an XML document.

That means that, if you wish, the two parts of the process (building
the device-independent formatting tree and rendering the tree) can be
handled by separate programs, since the XML provides a common
interchange standard.  If you plan to do the whole thing with a single
process, however, then there is no need actually to produce the XML
representation of the formatting tree -- just keep it as an internal
object tree.

Now, HTML is a special case, because it does not fit in well with
normal formatting semantics (it is considered bad practice to specify
font size, etc., in the document, though you can attach a CSS

I hope this helps.

All the best,


David Megginson                 david at megginson.com

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)

More information about the Xml-dev mailing list