You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Robert Bourdeau <bo...@ciesin.columbia.edu> on 2002/06/28 02:54:25 UTC

Unexpected behavior with imported stylesheets

Has anyone encountered this problem? Maybe it's not a problem,
but a feature!

I'm experimenting with aggregation, and the decomposition of 
stylesheets. When I change an "imported" stylesheet, it's not 
being applied by Cocoon until the "importing" stylesheet
is changed.

Environment:
	Tomcat 4.0.1
	Cocoon version 2.0.2-dev
	JRE 1.3.1

I have a pipeline that looks like this:

   <map:match pattern="aggregateit">
     <map:aggregate element="topelement">
          <map:part element="aElement" src="somefileA.xml"/>
          <map:part element="bElement" src="somefileB.xml"/>
     </map:aggregate>
     
     <map:transform src="stylesheets/aggregateit.xsl"/>
     <map:serialize type="html"/>
   </map:match>

The file aggregateit.xsl looks something like this:

--------------------------------------------------------
<xsl:stylesheet version="1.0" 
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:import href="part1core.xsl"/>
<xsl:import href="part2core.xsl"/>

<xsl:template match="topelement">
	blah blah requiring something from part1core.xsl
	blah blah requiring something from part2core.xsl
</xsl:template>
</xsl:stylesheet>
--------------------------------------------------------



Now, if I change part1core.xsl, the changes are not
showing up in the output of my aggregateit pipeline.
But if I just "touch" aggregateit.xsl, the changes in part1core.xsl
show up.

I haven't looked at the Cocoon code, but I have my suspicions about
why this happens. My question is, is this the intended behavior?
Maybe importing stylesheets isn't a good idea? 

Regards,

--- Bob


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Unexpected behavior with imported stylesheets

Posted by Peter Royal <pr...@apache.org>.
On Friday 28 June 2002 03:58 pm, J.Pietschmann wrote:
> Peter Royal wrote:
> > You are correct. There was a thread, its on a TODO, but nothing yet.
>
> Unless I'm mistaken, the 2.0.3 CVS includes included and
> imported style sheets in the validity check, committed
> by Carsten end of may. It won't still check for documents
> imported during pipeline run time by document(). The
> code also isn't yet in the 2.1 HEAD.

Nope! You are correct! Excellent. My co-workers will be thrilled to know that 
is in there!
-pete

-- 
peter royal -> proyal@apache.org

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Unexpected behavior with imported stylesheets

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Peter Royal wrote:
> You are correct. There was a thread, its on a TODO, but nothing yet.

Unless I'm mistaken, the 2.0.3 CVS includes included and
imported style sheets in the validity check, committed
by Carsten end of may. It won't still check for documents
imported during pipeline run time by document(). The
code also isn't yet in the 2.1 HEAD.

J.Pietschmann


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: Unexpected behavior with imported stylesheets

Posted by Jason Uithol <ja...@datacodex.net>.
Hello,

Shoot me if I'm wrong.

This is to do with the Source (?) class isn't it ?  It has a
lastModified(...) function.  Source is created for the "importing"
stylesheet, and lastModified of course returns the last modified of the
"importing" file.  It would have to open the file, *parse* it and
recursively traverse through it's import and include tags to find the
"imported" files ( and their "imported" files :) opening and parsing all
them as well, get _their_ last modifieds and keep track of the most recent
one out of that lot.

It is a pain to touch every single xsl that imports another one, but the
above approach, if implemented in the "raw" way described above, would cause
a lot of thrashing around !

I suppose this a better question for the dev list, but would their be an
easy way to monitor a list of files for their last modifieds ?  ( Like JBoss
does )  That might make a better solution available.


Jason.

-----Original Message-----
From: Peter Royal [mailto:proyal@apache.org]
Sent: Friday, 28 June 2002 12:41 PM
To: cocoon-users@xml.apache.org
Subject: Re: Unexpected behavior with imported stylesheets


On Thursday 27 June 2002 09:14 pm, Phil wrote:
> There was a thread about this some time back and I believe that it's on
> a to-do list somewhere. Is anyone at apache able to confirm this?
>
> Your 'touch' workaround is the only solution that I know of at this time.
>
> Anyone have any advances on this?

You are correct. There was a thread, its on a TODO, but nothing yet.
-pete

--
peter royal -> proyal@apache.org

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: Unexpected behavior with imported stylesheets

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Peter Royal [mailto:proyal@apache.org]
> 
> On Thursday 27 June 2002 09:14 pm, Phil wrote:
> > There was a thread about this some time back and I believe that it's
on
> > a to-do list somewhere. Is anyone at apache able to confirm this?
> >
> > Your 'touch' workaround is the only solution that I know of at this
time.
> >
> > Anyone have any advances on this?
> 
> You are correct. There was a thread, its on a TODO, but nothing yet.

Update:


This has been fixed in Cocoon 2.0.3 CVS and PATCH is pending (against
Avalon CVS) to fix this in Cocoon 2.1.

Vadim


> -pete
> 
> --
> peter royal -> proyal@apache.org
=


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Unexpected behavior with imported stylesheets

Posted by Peter Royal <pr...@apache.org>.
On Thursday 27 June 2002 09:14 pm, Phil wrote:
> There was a thread about this some time back and I believe that it's on
> a to-do list somewhere. Is anyone at apache able to confirm this?
>
> Your 'touch' workaround is the only solution that I know of at this time.
>
> Anyone have any advances on this?

You are correct. There was a thread, its on a TODO, but nothing yet.
-pete

-- 
peter royal -> proyal@apache.org

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Unexpected behavior with imported stylesheets

Posted by Phil <ph...@tcp.net.au>.
Imported stylesheets are not checked for modification and automatically 
rebuilt.

There was a thread about this some time back and I believe that it's on 
a to-do list somewhere. Is anyone at apache able to confirm this?

Your 'touch' workaround is the only solution that I know of at this time.

Anyone have any advances on this?

On Friday, June 28, 2002, at 10:54 AM, Robert Bourdeau wrote:

> Has anyone encountered this problem? Maybe it's not a problem,
> but a feature!
>
> I'm experimenting with aggregation, and the decomposition of
> stylesheets. When I change an "imported" stylesheet, it's not
> being applied by Cocoon until the "importing" stylesheet
> is changed.
>
> Environment:
> 	Tomcat 4.0.1
> 	Cocoon version 2.0.2-dev
> 	JRE 1.3.1
>
> I have a pipeline that looks like this:
>
>    <map:match pattern="aggregateit">
>      <map:aggregate element="topelement">
>           <map:part element="aElement" src="somefileA.xml"/>
>           <map:part element="bElement" src="somefileB.xml"/>
>      </map:aggregate>
>
>      <map:transform src="stylesheets/aggregateit.xsl"/>
>      <map:serialize type="html"/>
>    </map:match>
>
> The file aggregateit.xsl looks something like this:
>
> --------------------------------------------------------
> <xsl:stylesheet version="1.0"
>      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> <xsl:import href="part1core.xsl"/>
> <xsl:import href="part2core.xsl"/>
>
> <xsl:template match="topelement">
> 	blah blah requiring something from part1core.xsl
> 	blah blah requiring something from part2core.xsl
> </xsl:template>
> </xsl:stylesheet>
> --------------------------------------------------------
>
>
>
> Now, if I change part1core.xsl, the changes are not
> showing up in the output of my aggregateit pipeline.
> But if I just "touch" aggregateit.xsl, the changes in part1core.xsl
> show up.
>
> I haven't looked at the Cocoon code, but I have my suspicions about
> why this happens. My question is, is this the intended behavior?
> Maybe importing stylesheets isn't a good idea?
>
> Regards,
>
> --- Bob
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>