I have problem 1 resolved to some degree. I have two cincludes which work:

<!--Bring in the entire document-->
<div xmlns:cinclude="http://apache.org/cocoon/include/1.0";>
<cinclude:include src="http://commerce.wi.gov/SB/SB-CodeCouncils02.xml";
select="(*)"/>
</div>

<!--Bring in part of the document-->
<div xmlns:cinclude="http://apache.org/cocoon/include/1.0";>
<cinclude:include src="http://commerce.wi.gov/SB/SB-DivDailyDoc-Hayward.xml";
select="(/page/content/[EMAIL PROTECTED]'Updated']/span)" />
</div>

When I take the first cinclude and modify as such

<!--Bring in part of the document-->
<div xmlns:cinclude="http://apache.org/cocoon/include/1.0";>
<cinclude:include src="http://commerce.wi.gov/SB/SB-CodeCouncils02.xml";
select="(/html/body/p[2])"/>
</div>

or 

<!--Bring in part of the document-->
<div xmlns:cinclude="http://apache.org/cocoon/include/1.0";>
<cinclude:include src="http://commerce.wi.gov/SB/SB-CodeCouncils02.xml";
select="(*/html/body/p[2])"/>
</div>

or 

<!--Bring in part of the document-->
<div xmlns:cinclude="http://apache.org/cocoon/include/1.0";>
<cinclude:include src="http://commerce.wi.gov/SB/SB-CodeCouncils02.xml";
select="(*//body/p[2])"/>
</div>


I get an empty include. Any thoughts on this? The src in each include are
live so if someone would like to test feel free to do so. 


Problem 2 still not resolved. I tried Aurélien's solution but could not get
it to work. 

Getting this to work would help me continue to sell Cocoon within my agency.

Gary T. Schultz
Web Technical Administrator / GIS Coordinator
Wisconsin Department of Commerce
6th Floor
P.O. Box 7970
Madison, WI 
1-608-266-1283


-----Original Message-----
From: Aurélien DEHAY [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 22, 2005 10:23 AM
To: users@cocoon.apache.org
Subject: Re: XInclude and CInclude


Schultz, Gary - COMM wrote:
> 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;/*"
> 
> Now I can bring in the document fine, but I cannot tweak this to bring in
> specific element(s). 
> 
> 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.
> 
> Suggestions are greatly appreciated.
> 

Don't know about problem 1, but it may help to use xpointer, maybe.
For 2), I suppose the solution is to:

create a pipeline for serializing the html to xml:
<map:match pattern="name_toxml">
   <map:generate type="html" src="http://your_url"/>
   <map:serialize type="xml"/>
</map:match>

and use the pseudo-protocol cocoon:/ in the src of your cinclude element.

-- 
Aurélien

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to