cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geert Josten <>
Subject Re: XInclude and CInclude
Date Tue, 22 Feb 2005 16:18:06 GMT
Hi Gary,

> I have cinclude working to bring in external source. I now need to solve two
> more problems. 
> Problem 1:
> I can bring in entire documents, but I cannot get specific element(s). I was
> getting empty element, but used the following found on the Cocoon wiki
> select="//*&#91;local-name()='html'&#93;/*"

Something went wrong with this expression?

> Now I can bring in the document fine, but I cannot tweak this to bring in
> specific element(s). 

Using XInclude, it should be possible to add a xpointer expression to your url. Something
like where zzz can be some xpath expression... Never tried, but should work..

> Problem 2:
> I tried bringing into an xml document an external source that is html. I use
> the default generator which is set to xml. I believe I need to bring in the
> resource, JTidy, and serialize as xml before using in the cinclude. I've
> tried some things based on what I have seen in the Cocoon samples, but
> nothing works. I'm at a loss as to where I should go from here.

Ah, nice one. Did that just recently. I have set up a cocoon pipe that uses the html generator

(which uses JTidy) and simply serializes that to xml (e.g. xhtml). I've done something like

<map:match pattern="get-html/**">
   <map:generate type="html" src="cocoon:/{1}"/>
   <map:serialize type="xml" />

<map:match pattern="get-http/**">
   <map:read src="http:/{1}"/>

<xi:include src="cocoon://get-html/get-http/" parse="xml" />

(may contain some typos :-P )

> Suggestions are greatly appreciated.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message