cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fennell, Philip" <philip.fenn...@hp.com>
Subject Xinclude transformer has changed behaviour with Saxon 8.7.1+
Date Mon, 19 Jun 2006 11:38:31 GMT
I have previously posted regarding this problem, and have been rather
busy since then, but this time I have an example test case for someone
to mull over.

With Windows XP sp2, Cocoon 2.1.8, Tomcat 5.5 and Saxon 8.6.1 or 8.7
configured as the default XSLT transformer I was able to embed
xi:include instructions within source documents and have Cocoon's
Xinclude processor resolve the URL (relative to the source document)
correctly.

e.g.

<xi:include href="../../content/resources/site/login.xml">
  <xi:fallback>login.xml not included.</xi:fallback> </xi:include>

However, when I moved to Saxon 8.7.1 (and also with 8.7.3) the xinclude
fails to locate the referenced file unless I change the href attribute
so that the url is relative to the current Cocoon context.

e.g.

<xi:include href="content/resources/site/login.xml">
  <xi:fallback>login.xml not included.</xi:fallback> </xi:include>



Important Note:
===============

It is important to understand that I am 'NOT' using Cocoon to process
the requested document but rather to process the request (by using
Cocoon's request generator) information itself, which includes a
refernece to the original requested document. The request info is
transformed into an 'envelope' containing the request parameters, HTTP
header info and an interface definition file that may contain xi:include
instructions that reference additional static content. It is these
xi:include instructions that are at the centre of the problem. The
example is in:

xinclude/interface/config/login.xml

The Cocoon pipeline match that does all the work can be found starting
at line 182 of sitemap.xmap.

During the processing, the requested content and referenced content
merged and transformed into XHTML within the main rendering transform:

xinclude/interface/transforms/xhtml/screen.xsl

===============



To run the test webapp that I have attached you will need to set-up
Cocoon as follows:

1) Add the following lines to cocoon/WEB-INF/cocoon.xconf:

  <component logger="core.xslt-processor"
      role="org.apache.excalibur.xml.xslt.XSLTProcessor/saxon"
      class="org.apache.excalibur.xml.xslt.XSLTProcessorImpl">
    <parameter name="use-store" value="true"/>
    <parameter name="incremental-processing" value="false"/>
    <parameter name="transformer-factory"
value="net.sf.saxon.TransformerFactoryImpl"/>
  </component>

after the Xalan component declaration.


2) Get Saxon 8.7 and 8.7.3 from http://www.saxonica.com/ and place the
following jars in cocoon/WEB-INF/lib

saxon8.jar
saxon8-dom.jar
saxon8-xpath.jar


3) Unpack the attached ZIP file (xinclude.zip) in your cocoon directory


4) Use the following link to access the test page:

http://localhost:8080/cocoon/xinclude/interface/config/login.html

(Depending on host and port number etc you may need to tweak this url.)


I am cross-posting this on the saxon-help mailing list too as they may
have a view as to what may have changed that has contributed to this new
behaviour.


Regards

Philip Fennell

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


Mime
View raw message