forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@apache.org>
Subject Re: xinclude
Date Mon, 04 Sep 2006 08:36:03 GMT
Jim Dixon wrote:
> 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">
>>>

...

>>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?

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...

>>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.

That is as expected and serves to confirm that the problem is either in 
the Include processing or in your project sitemap. But we do not know 
which yet. Lets read on...

>>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.

>>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')

These are not a problem, note they are "WARN"ings (first entry in the 
line), they are not errors.

You now need to turn your xinclude stuff back on and find the errors 
that are reported in the logs, this will tell us what the problem is.

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.

Ross

Mime
View raw message