xsl-list
[Top] [All Lists]

RE: selecting into an included stylesheet

2006-01-30 13:38:22
Thank you!

I had initially been using the document function with a URI as Michael
suggested but ran into a race condition in the wild (not to mention some
very odd caching).

Dimitre's suggestion of parking the nodeset in a variable before
inclusion works well.

Utah Ingersoll

-----Original Message-----
From: Dimitre Novatchev [mailto:dnovatchev(_at_)gmail(_dot_)com] 
Sent: Monday, January 30, 2006 3:11 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] selecting into an included stylesheet

On 1/31/06, Michael Kay <mike(_at_)saxonica(_dot_)com> wrote:
If you know the URI of the stylesheet you want to access -- which you
do,
because you included it -- you can get it using the document()
function just
like any other XML document. (That's all that document('') is doing).

A more user-friendly way that does not require remembering all those
file-names (which, btw could change in time) is to have in every
stylesheet a global variable with easy to remember name:

  <xsl:variable name="vdocThisStylesheet" select="document('')"/>

Then, this document is accessible within every other stylesheet of the
import tree by simply:
             $vdocThisStylesheet


--
Cheers,
Dimitre Novatchev
---------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>