On Mon, 4 Sep 2006, Ross Gardler wrote:
> > 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?
>
> I appreciate that, but you already have the "how-to" from Thorstens
> previous responses and the existing Forrest code (do a search for
> xi:include in the plugins directory, you will find it in use. For now,
> read on...
Searching forrest/plugins with
grep -e "xi:include" -rl * | grep -v svn
I found two files in which XInclude is used.
> >>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?
>
> No that is fine. You also define the xinclude transformer in your
> sitemap, this is not necessary as it is defined in the root Forrest
> sitemap, but it will not be causing a problem.
There was actually an error here:
<document xmlns:xi="http//www.w3.org/2001/XInclude">
The colon after "http" was omitted.
If the colon is inserted, then we once again get
Message: Resource Not Found
Description: The requested resource "/eg/logMeIn.html" could not be found.
Sender: org.apache.cocoon.servlet.CocoonServlet
Source: Cocoon Servlet
and the logs contain
---------------------------------------------------------------------------
WARN (2006-09-04) 10:15.19:459 [access] (/eg/logMeIn.html)
PoolThread-4/CocoonServlet: Resource not found.
at <map:serialize type="xml-document"> -
file:/home/j2ee/forrest/main/webapp/forrest.xmap:230:47
at <map:transform> -
file:/home/j2ee/forrest/main/webapp/forrest.xmap:128:65
at <map:generate> -
file:/home/j2ee/forrest/main/webapp/forrest.xmap:226:42
at <map:serialize> -
file:/home/j2ee/forrest/main/webapp/sitemap.xmap:326:23
at <map:transform> -
file:/home/j2ee/forrest/main/webapp/sitemap.xmap:324:73
at <map:transform> -
file:/home/j2ee/forrest/main/webapp/sitemap.xmap:318:72
at <map:transform> -
file:/home/j2ee/forrest/main/webapp/sitemap.xmap:296:42
at <map:transform> -
file:/home/j2ee/forrest/main/webapp/sitemap.xmap:571:65
at <map:transform type="linkrewriter"> -
file:/home/j2ee/forrest/main/webapp/sitemap.xmap:570:79
at <map:transform type="xinclude"> -
file:/home/j2ee/forrest/main/webapp/sitemap.xmap:569:41
at <map:transform type="idgen"> -
file:/home/j2ee/forrest/main/webapp/sitemap.xmap:568:38
at <map:generate> -
file:/home/j2ee/forrest/main/webapp/sitemap.xmap:567:49
at <map:serialize> -
file:/home/j2ee/forrest/main/webapp/sitemap.xmap:326:23
at <map:transform> -
file:/home/j2ee/forrest/main/webapp/sitemap.xmap:324:73
at <map:transform> -
file:/home/j2ee/forrest/main/webapp/sitemap.xmap:318:72
at <map:transform> -
file:/home/j2ee/forrest/main/webapp/sitemap.xmap:296:42
---------------------------------------------------------------------------
Yes, this is a warning, but it does appear to be quite relevant.
If I reintroduce the error (delete the colon), then the error message goes
away.
The error occurs at line 230 in main/forrest.xmap, which is the
serialization stage in i18n of XML files. It looks to me like the
preceding transform-to-document stage is producing the wrong type of
content.
> One thing I did not pick up on in your original post, but want to
> clarify now is the line:
>
> "foo.txt is just a line of nonsense."
>
> Is it a line of *XML* nonsense? The XInclude transformer is an
> implementation of the XINclude specification which is an XML
> specification (see the Cocoon docs Thorsten pointed you at). It will
> only work with XML source files.
;-)
--
Jim Dixon [EMAIL PROTECTED] tel +44 117 982 0786 mobile +44 797 373 7881