RE: [xsl] Rendering HTML via XSLT with multiple source XML documents

Subject: RE: [xsl] Rendering HTML via XSLT with multiple source XML documents
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Fri, 30 Nov 2001 23:22:49 -0000
> I've been working with XSLT files for a short while creating
> simple html
> applications such as maintaining glossaries of terms in XML and
> rendering them via XSLT to .html pages.  I've now been assigned a task
> that requires an html page to be created from multiple XML sources of
> different information.
> Can anyone provide me with a simple explanation, or a good web
> reference, that summarizes how a single XSLT can be used to create
> static HTML pages utilizing multiple source XML files of
> different types
> of information.

Well, the simple and obvious answer is "use the document() function". But
that's not the only way, and not always the best way. There are at least
three other ways to get multiple inputs to a stylesheet: you can load them
as XML entities, you can supply them as parameters to a transformation, or
you can merge documents using a non-XSLT process (e.g. a SAX filter) in
advance of transformation.

You talk of creating static HTML pages, so you're obviously thinking of
multiple output files as well as multiple inputs, and that raises further
options of whether you're going to run one transformation to produce each
output file or whether you want to produce multiple outputs from a single

And then, you say the multiple source files are "different types of
information", which suggests you probably want to keep the stylesheet
modular so that different stylesheet modules are concerned with different
"types of information". I also sometimes advise using modes, just to avoid
accidental clashes between different sets of rules, and to maximise the
opportunity for reuse.

In short, if you're designing a substantial system then there are many
degrees of freedom and one needs to know a lot more about the actual system
requirements to decide what's most appropriate.

> Do any of the XSL editing tools on the market support this feature?

I tend to put the XSL tools into two categories: those that address the
design of stylesheets, and those that only address the coding and debugging.
I don't think any of the design tools (at least, the ones I've seen)
currently give you much help with anything but rather simple
> Thanks!
> Brian Magick
Hope that's useful, and feel free to contact me directly: I think you've got
my SoftwareAG email, which is less likely to suffer from hasty use of the
delete key than things on this list!

Mike Kay

 XSL-List info and archive:

Current Thread