cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars Huttar <lars_hut...@sil.org>
Subject Re: cinclude usage/alternatives
Date Tue, 21 Feb 2006 16:35:04 GMT
Bruyn Bill wrote:
> For various reasons, I need to retrieve some markup from a remote 
> resource, and insert my jx result inline.  e.g., I have some remote 
> file called wrapper.xhtml that looks like
>  
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>                       
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
>     <head>
>         <title></title>
>     </head>
>     <body>
>       <table>
>         <tr>
>           <td>Here is some static content</td>
>           <td class="webapp">and a placeholder for dynamic stuff</td>
>         </tr>
>       </table>
>     </body>
> </html>
>  
> Where I need to replace the contents of //td[@class='webapp'] with 
> 'whatever'.  It isn't the way I would have chosen to put it together, 
> but it seems like a reasonable requirement that I should be able to 
> handle with the sitemap and a cinclude transform.  Right?
>  
> No luck though with several hours of experimentation and the usual 
> looking through google, samples, wiki, archives, userdoc, etc.  BTW, 
> the cinclude is really very slow...  Is this the recommended method, 
> or am I barking up the wrong tree here?
>  
As an alternative to using <map:aggregate>, you could run your 
wrapper.xhtml through a stylesheet transformation that replaces 
//td[@class='webapp'] with <cinclude:include 
src="cocoon:/my-pipeline-for-whatever" />; then follow that with the 
cinclude transform:

<map:match pattern="something">
  <map:generate src=".../wrapper.xhtml" />
  <map:transform src="replace-td-with-cinclude.xsl" />
  <map:transform type="cinclude" />
  <map:serialize type="xml" />
</map:match>

Does that address what you're trying to do?
Lars


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message