cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 33603] New: - Incorect xsl stylesheets caching with xsl:include and cocoon: protocol
Date Wed, 16 Feb 2005 11:31:10 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33603>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33603

           Summary: Incorect xsl stylesheets caching with xsl:include and
                    cocoon: protocol
           Product: Cocoon 2
           Version: 2.1.6
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P3
         Component: sitemap components
        AssignedTo: dev@cocoon.apache.org
        ReportedBy: eltehaem@poczta.onet.pl


I have problem with caching of xsl stylesheets. Here is a simplified
example, I have layout.xsl pipeline:

<map:match pattern="layout.xsl">
  <map:select type="host">
    <map:when test="foo">
      <map:generate src="layout_foo.xsl"/>
    </map:when>
    <map:otherwise>
      <map:generate src="layout_bla.xsl"/>
    </map:otherwise>
  </map:select>
  <map:serialize type="xml"/>
</map:match>

When I try it on browser it works correctly, and depending on host name
I see different layout_*.xsl files. This pipeline I include in a
stylesheet named test.xsl:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:include href="cocoon:/layout.xsl"/>
</xsl:stylesheet>

And test.xsl is used in another pipeline:

<map:match pattern="test">
  <map:generate src="test.xml"/>
  <map:transform type="xslt" src="test.xsl"/>
  <map:serialize type="xml"/>
</map:match>

This time, when I try it in browser the request is cached and output
does not vary on host name. For example i try:
http://foo.localhost/test -> Foo layout (ok)
http://bla.localhost/test -> Foo layout (but should be Bla layout)

When i restart server and first try:
http://bla.localhost/test -> Bla layout (ok)
http://foo.localhost/test -> Bla layout (but should be Foo layout)

Simply speaking first request is cached. I've tried setting pipeline to
"noncaching" and transformer to "use-request-parameters" but with no
success (sitemap included at the end of this mail). The only way I can
solve this is turning off "use-store" for transformers in cocoon.xconf,
but I think this would reduce performance.

The question is: Am I doing something wrong? Or is it a bug in
stylesheets caching?

My sitemap is:

<?xml version="1.0"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  <map:components>
    <map:transformers>
        <map:transformer logger="sitemap.transformer.xslt" name="xslt"
pool-grow="2" pool-max="32" pool-min="8"
src="org.apache.cocoon.transformation.TraxTransformer">
          <use-request-parameters>false</use-request-parameters>
          <use-session-parameters>false</use-session-parameters>
          <use-cookie-parameters>false</use-cookie-parameters>
          <xslt-processor-role>xalan</xslt-processor-role>
          <check-includes>true</check-includes>
        </map:transformer>
    </map:transformers>
    <map:selectors>
      <map:selector logger="sitemap.selector.host" name="host"
        src="org.apache.cocoon.selection.HostSelector">
        <host name="foo" value="foo.rastapla"/>
        <host name="bla" value="bla.rastapla"/>
      </map:selector>
    </map:selectors>
  </map:components>
  <map:pipelines>
    <map:pipeline type="noncaching">
      <map:match pattern="layout.xsl">
        <map:select type="host">
          <map:when test="foo">
            <map:generate src="layout_foo.xsl"/>
          </map:when>
          <map:otherwise>
            <map:generate src="layout_bla.xsl"/>
          </map:otherwise>
        </map:select>
        <map:serialize type="xml"/>
      </map:match>
      <map:match pattern="test">
        <map:generate src="test.xml"/>
        <map:transform type="xslt" src="test.xsl"/>
        <map:serialize type="xml"/>
      </map:match>
    </map:pipeline>
  </map:pipelines>
</map:sitemap>

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Mime
View raw message