cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Howard <ghow...@crosswalk.com>
Subject RE: Detecting change on XML included with document() to reset cac he?
Date Tue, 21 May 2002 18:25:59 GMT
could you just transform the list xml to cinclude the others via cocoon
pseudo-urls?

...
<xsl:template match="/list">
  <list xmlns:cinclude="http://apache.org/cocoon/include/1.0">
    <xsl:apply-templates />
  </list>
</xsl:template>

<xsl:template match="/list/file">
  <cinclude:include />
  <xsl:attribute name="src"/>
    <xsl:text>cocoon:/</xsl:text><xsl:value-of select="."/>
  </xsl:attribute>
</xsl:template>

Something like that?  I didn't test the attribute setting there - you may
need to do something trickier like set a variable and then use concat().

With care you may be able to do this in a portable way though not with the
document function.  The problem I see with asking the file generator to
check dependencies is the overhead of parsing the entire document on every
request.

Geoff Howard

-----Original Message-----
From: Hunsberger, Peter [mailto:Peter.Hunsberger@stjude.org]
Sent: Tuesday, May 21, 2002 11:38 AM
To: 'cocoon-users@xml.apache.org'
Subject: Detecting change on XML included with document() to reset
cache?


Using Cocoon 2.0.2 Tomcat 4.0.4b JBoss 2.4.4 JRE 1.4.0

I have a straight forward sub-site that invokes a simple 1 stage XML to HTML
pipeline.  The main xml target of the pipeline is just a list of the real
xml files that are to be processed, eg:

<list>
   <file>file-a.xml</file>
   <file>file-b.xml</file>
   <file>file-c.xml</file>
</list>     

The style sheet uses the XSLT document() function to process these files.
The problem is that usually only the referenced files are updated, the main
xml and xsl are mostly static.  As a result Cocoon never sees the changes
and never clears the cache.  Is there a simple way to tell Cocoon to check
the referenced files?  

I realize I could restructure this to have a Cocoon pipeline aggregate the
files and process them.  However, that approach has two problems: 1) the
current method is portable to any XSLT engine; 2) the XML file that
determines the included files is visible to the users for when an occasional
update is required.  I don't want to expose the sitemap to the users due to
security/integrity and training issues.

Peter Hunsberger

Phone: 901-495-5252
E-mail: Peter.Hunsberger@stjude.org


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

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

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

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


Mime
View raw message