On Jun 18, 2005, at 1:04 AM, Geert Josten wrote:
Hi,
Anybody know a way to access sitemap globals from within a
stylesheet? (That is, w/o passing them in as stylesheet parameters).
I'm using Saxon. Any ideas welcome! :-)
thx,
—ml—
I replied earlier that I used the RequestGenerator to get parameters
into the stream. Doing so, you can pass a pipe uri to the stylesheets
that refers to that generator. Just use the document() function inside
the stylesheet, to access the pipe and you will have the parameters
available as XML tree...
:-)
Hi Geert,
OK, if I have to use a pipeline for this, I would use the module
source, e.g.
<match pattern="globals/*">
<generate src="module:global:{1} />
<serialize type="xml" />
</match>
That oughta work, right?
By the way, make sure that the parameters pipe is noncaching. There
was something wrong with the caching of document function in XSL's...
It's not really "wrong" as such... it just doesn't work, because
document() "flies under the radar" of the Cocoon caching system. That
is, it creates a dependency of one resource upon of which there's no
way Cocoon can be aware, so there's no way for cocoon to know when to
invalidate the cache.
However, with globals it shouldn't even matter, since those aren't
going to change :-)
Cheers,
—ml—
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]