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:[EMAIL PROTECTED]]
Sent: Tuesday, May 21, 2002 11:38 AM
To: '[EMAIL PROTECTED]'
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: [EMAIL PROTECTED]


---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to