At 03:02 PM 09/14/2000 +0100, Sam Salt wrote:
>I follow the common practice of using an HTML table for web page layout.
>Does anyone know of a way to insert the whole contents of an XML file with
>associated CSS or XSL into a single cell in that table?
Two ways possible that I can think of:
(1) Use an external entity reference to pull it in where needed. Problem
with this is that I don't know if the inserted file's stylesheet PI will be
honored. (Anybody else know?)
(2) [Probably the one I'd pick] Use the XSLT document() function in the
stylesheet for the "master" document, passing it the URI of the file to be
inserted. This returns a node-set containing all the nodes in that file,
and this node-set can then be manipulated in the same way as one from the
master document itself, e.g. by placing its contents into a <td> element in
the result tree. If this external file has an XSLT stylesheet of its own,
use an xsl:import or xsl:include in the master file's stylesheet to bring
those transformations in. (Will have to be careful of
overlapping/conflicting template rules, but otherwise should work okay.) If
there are two CSS stylesheets involved you may also be able to use the
@import rule to include the imported file's rules into the master one's.
John E. Simpson | "I used to be an airline pilot. I got fired.
http://www.flixml.org | I kept locking the keys in the plane. They
[log in to unmask] | caught me on an 80-foot stepladder with a
| coathanger." (Steven Wright)