On Sun, 3 Sep 2006, Ross Gardler wrote: > Jim Dixon wrote: > > On Thu, 29 Jun 2006, Thorsten Scherler wrote: > >>Have a look at > >>http://cocoon.apache.org/2.1/userdocs/xinclude-transformer.html > >>and add xmlns:xi="http://www.w3.org/2001/XInclude" to the document tag > >>like: > >><document xmlns:xi="http://www.w3.org/2001/XInclude"> > > > > Has anyone been able to get this working with Forrest? I have followed > > their instructions closely but it appears that the transformed file > > doesn't get passed on.
OK, this file, created after reading the advice above, has been dropped: > > -- sitemap.xmap --------------------------------------------------------- > > <?xml version="1.0"?> > > <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0"> > > <map:components> > > <map:transformers default="xslt"> > > <map:transformer name="xinclude" > > src="org.apache.cocoon.transformation.XIncludeTransformer"/> > > </map:transformers> > > </map:components> > > <map:pipelines> > > <map:pipeline> > > <map:match pattern="eg/logMeIn.xml"> > > <map:generate src="eg/logMeIn.xml"/> > > <map:transform type="xinclude"/> > > <map:serialize type="xml"/> > > </map:match> > > </map:pipeline> > > </map:pipelines> > > </map:sitemap> This file remains: > > -- logMeIn.xml ---------------------------------------------------------- > > <?xml version="1.0" encoding="UTF-8"?> > > <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" > > "http://forrest.apache.org/dtd/document-v20.dtd"> > > <document xmlns:xi="http//www.w3.org/2001/XInclude"> > > <header><title>logMeIn</title></header> > > <body> > > <source> > > <xi:include parse="text" href="eg/foo.txt"/> > > </source> > > </body> > > </document> > > ------------------------------------------------------------------------- > > foo.txt is just a line of nonsense. > XInclude works fine in Forrest, it is used internally in a few places. The question is not whether XInclude works in Forrest. It's a simple how-to: how do you XInclude a text file in a Forrest document? > Try commenting out the xi:include element in your source and remove your > project sitemap. Does it work? If the project sitemap is removed, then the page appears, but without any XIncluded text. > If it does work then it is something to do with your use of Xinclude, My only use of XInlude appears above. In logMeIn.xml I (a) add an xmlns:xi attribute to the document element (b) add the xi:xinclude element Is either incorrect? Is there something else I should be doing? > you should find more information in the logs (see our FAQ if you don't > know where they are). If they don't help you paste anything you think > may be useful here. > > Ross FWIW I used svn to get the very latest version of Forrest a few minutes ago, did a 'forrest run', and then used my browser to look at logMeIn.xml. The log then contains three identical entries: ------------------------------------------------------------------------- WARN (2006-09-04) 08:11.53:847 [core.manager] (/eg/logMeIn.html) PoolThread-4/CoreServiceManager: ComponentLocator exception from parent SM during lookup. org.apache.avalon.framework.service.ServiceException: Component for key 'org.apache.cocoon.components.treeprocessor.TreeBuilder/sitemap-1.0' not found. (Key='Cocoon') at org.apache.cocoon.core.container.SingleComponentServiceManager.lookup(SingleComponentServiceManager.java:68) at org.apache.cocoon.core.container.CoreServiceManager.lookup(CoreServiceManager.java:355) at org.apache.cocoon.components.treeprocessor.TreeProcessor.getTreeBuilder(TreeProcessor.java:375) at org.apache.cocoon.components.treeprocessor.TreeProcessor.buildConcreteProcessor(TreeProcessor.java:720) at org.apache.cocoon.components.treeprocessor.TreeProcessor.setupConcreteProcessor(TreeProcessor.java:394) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:288) at org.apache.cocoon.Cocoon.process(Cocoon.java:557) at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:364) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:354) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567) at org.mortbay.http.HttpContext.handle(HttpContext.java:1808) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:525) at org.mortbay.http.HttpContext.handle(HttpContext.java:1758) at org.mortbay.http.HttpServer.service(HttpServer.java:879) at org.mortbay.http.HttpConnection.service(HttpConnection.java:790) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:952) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:807) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:197) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:501) ------------------------------------------------------------------------- -- Jim Dixon [EMAIL PROTECTED] tel +44 117 982 0786 mobile +44 797 373 7881