[xsl] Import stylesheet

Subject: [xsl] Import stylesheet
From: "Mark Williams" <mark@xxxxxxxxxxx>
Date: Tue, 11 Oct 2005 10:54:29 +0100
Hi,

I need to import a stylesheet into another stylesheet, but the
stylesheet to be imported needs to be created on the fly.  I was hoping
to do this by creating the import stylesheet and posting it to a
randomly named url and passing in that url as a paramater of the
importing stylesheet.  However, the href attribute of the import
statement requires quotation marks so I'm guessing parameters are not
acceptable.  The include statement also won't work for the same reasons.
There is a section in the spec (para 2.7 Embedding Stylesheets) which
suggests of two other options, which look like they could be of help to
me, but as usual I'm struggling to work out how to use them.

What I am basically trying to do is to have a default letter template
(the importing stylesheet), which provides the basic layout of the
document.  Users are then able to create letters on the fly using a
fairly basic word processor.  When they are finished the rtf text is
converted to a xsl stylesheet (the imported stylesheet).  Somehow, I
need to pass the imported stylesheet to the importing stylesheet.  I
could provide a fixed url for the importing stylesheet to import from
and always post the imported stylesheet to that url before calling the
rendering process.  The difficulty with this is that this will be used
across a network and there may be overwriting issues.

It would be ideal if I could just pass the stylesheet as a node within
the xml file that is being passed tot eh omporting stylesheet at the
time of rendering.  Para 2.7 seems to be suggesting (at least to me)
that this is possible.

Could somebody please advise whether this can be done and, if possible
provide some sample code.  If it cannot be done, how else can I achieve
my objective?

Thanks in advance.

Mark Willliams

Current Thread