cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Dzmura <...@digital-mission.com>
Subject multiple layers of XSLT ...
Date Thu, 30 Mar 2000 22:37:05 GMT
Hi:

I am trying to do multiple layers of stylesheet-drive XSL transformations to a single
.xml file.  (Presently, the number of transformations is two, but it will grow for some
purposes...)

In addition, I have written a simple processor to dynamically add some stuff into
the Document.  (In fact, this part is working and doing exactly what I expect it to do...)

To summarize,  I want to first run my processor, then apply two levels of XSL transformation,
then format for web presentation.  (Of course, I could just use a single level of transformation
and one .xsl file, but that would defeat my purpose of separating the development and
maintenance of the different transformations... something which Cocoon should help
me to do!!)

Continuing on, at first I thought I could simple-mindedly do something like this in the .xml
files:

----------

<?cocoon-process type="nav"?>        // my processor - this works

<?cocoon-process type="xslt"?>
<?xml-stylesheet href="http://foobar.net/digipath/dphome.xsl" type="text/xsl"?>

<?cocoon-process type="xslt"?>
<?xml-stylesheet href="http://foobar.net/digipath/dpframe.xsl" type="text/xsl"?>

// formatter is the default

----------

Although the individual stylesheets are verified to work, the combination did not
do what I expected...  So I went to the Cocoon sources.

What I seemed to find there is that any attempt to execute a Processor with a given
MIME type and web browser type is always going to be associated with the first
matching stylesheet!!  In essence, the "dphome.xsl" stylesheet would be applied
for both transformations...  Is this correct, or am I missing something??

If so, I am trying to think of a way to eliminate this problem... An obvious candidate is
to
remove the <?xml-stylesheet> node after encountering it, so that it will not be selected
the next time through... this is already done with

However, how does this interact with the caching store??  If the store caches Documents,
then it would have to maintain unmodified, virginal copies and make a fresh copy for each
pass through the Engine...

Does anybody have any ideas??  Or am I going about this the wrong way ??

Thanks,
Mark Dzmura

p.s. Another issue with the XSLT processor relates to absolute paths to style sheets..
I have .xml files in multiple levels of subdirectories, but want many of them to refer to
a single stylesheet stored in a directory of stylesheets.  However, I have only been able
to do this using a URL to name the stylesheets!  If I use a web-based absolute file
name, the XSLT processor cannot find it - the XSLTProcessor code seems to confirm that the
stylesheet file name is computed relative to the location of the .xml file ... which
has unpleasant ramfications for managebility of large sites.

Has anybody else run into this??

--
)))) This email routed via a wireless gateway!! ((((



Mime
View raw message