cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Daniel <alexander.dan...@gmx.at>
Subject Re: appending to existing HTML
Date Mon, 06 Oct 2008 16:27:20 GMT
On 06.10.2008, at 13:23, arj123 wrote:

>
> Hi all,
> I want to append the output HTML (created by transforming XML using  
> XSL
> using cocoon) to my existing HTML.
> Is it possible using cocoon?

Yes, this is possible with the HTML generator, some XSLT and the  
include transformer.

addInclude.xsl copies the XML and adds a i:include element just before  
the closing body tag. The include transformer inserts the output HTML  
from another pipeline.

sitemap fragment:
<map:generate type="html" src="existing.html"/>
<map:transform src="addInclude.xsl"/>
<map:transform type="include"/>
<map:serialize type="html'/>

addInclude.xsl:
<xsl:stylesheet xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform

" version="1.0">

		<xsl:template match="xhtml:body">
			<xsl:copy>
				<xsl:apply-templates select="@* | node()"/>
				<i:include xmlns:i="http://apache.org/cocoon/include/1.0"
					src="cocoon:/outputHtml"/>				
			</xsl:copy>
		</xsl:template>
		
		<xsl:template match="node() | @*">
			<xsl:copy>
				<xsl:apply-templates select="@* | node()"/>
			</xsl:copy>
		</xsl:template>
			
</xsl:stylesheet>

Alex



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


Mime
View raw message