On Mon, 4 Sep 2006, Ross Gardler wrote: > > 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. > > It is not mandatory, you can use any protocol you like in the xinclude > just as you can in any url anywhere in Forrest. > > If it works with the cocoon: protocol, but not with the relative path > that you had previosuly then the actual location of your txt document > was different from the relative path you define i your xinclude.
I just tried each of the following in turn: <xi:include parse="text" href="foo.txt"/> <xi:include parse="text" href="eg/foo.txt"/> <xi:include parse="text" href="/eg/foo.txt"/> <xi:include parse="text" href="cocoon://eg/foo.txt"/> The first three fail as previously described. The last succeeds. foo.txt is actually located in src/documentation/content/xdocs/eg I have not yet seen xi:include work for anything other than (a) a bare file name preceded with the cocoon:// or (b) various types of indirect reference like href="{.}" I suspect that these indirect references are logically equivalent to the cocoon:// prefix. [But read on ...] As regards > It is not mandatory, you can use any protocol you like in the xinclude > just as you can in any url anywhere in Forrest. I experimented by adding <xi:include parse="text" href="http://localhost/foo.txt"/> To my surprise, this worked, as does <xi:include parse="text" href="file:///var/www/docs/foo.txt"/> This isn't exhaustive testing, but it appears that any protocol will do, but just a bare file name won't. [Fiddles some more ...] No, that's not right. <xi:include parse="text" href="/var/www/docs/foo.txt"/> works too. So an absolute path will work. But I could not find any relative path that would. -- Jim Dixon [EMAIL PROTECTED] tel +44 117 982 0786 mobile +44 797 373 7881