forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Dixon <...@dixons.org>
Subject Re: xinclude
Date Mon, 04 Sep 2006 12:30:23 GMT
On Mon, 4 Sep 2006, Ross Gardler wrote:

> If you add your XInclude stuff back in you get a resource not found error.

Not quite.  There was a type in the xnlns:xi attribute:
  <document xmlns:xi="http//www.w3.org/2001/XInclude">
If I get the page with this setup, the page appears on the screen, but
of course without the contents of foo.txt.  If I put the colon in, I
get a "Resource Not Found" error.

> You say that the logs do not tell you exactly which file is missing
> (which is very unusual by the way, are you sure there is no file not
> found exception in the logs?)

Well, there are three identical ComponentLocator exceptions and
--------------------------------------------------------------------------
WARN    (2006-09-04) 13:05.56: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
--------------------------------------------------------------------------

> Since your original source is being found, it must be your included
> source that is not being found. You can confirm this by requesting
> eg/logMeIn.xml - you should see an XML document complete with your
> unprocessed XI:Include statements.

This works, returning the unprocessed
  <xi:include parse="text" href="eg/foo.txt"/>

What may be significant is that the xlns:xi attribute has been stripped
from the <document> element.  [Well, perhaps not.  Read on.]

> So, check the location of your source document relative to your included
> document and verify that the path in the source document is the same.

They are.

> Note: it is better to use the cocoon:// protocol to resolve files since
> this will make your source files more portable.

Portability is a luxury to those of us whose simple, non-portable files
don't work.  :-)

However! If I change the element to

  <xi:include parse="text" href="cocoon://eg/foo.txt"/>

it works.  I will be experimenting with this further, but it appears
that the cocoon:// protocol is not just a Good Thing but mandatory.

For the record, there are 4 uses of xi:include below forrest/plugins.
Three use the cocoon:// protocol and one uses href="{.}"


> [1]
> http://mail-archives.apache.org/mod_mbox/forrest-user/200609.mbox/browser

--
Jim Dixon  jdd@dixons.org   tel +44 117 982 0786  mobile +44 797 373 7881

Mime
View raw message