You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by arj123 <ar...@unnat-e.com> on 2008/10/06 13:23:34 UTC

appending to existing HTML

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?

Thanks
-- 
View this message in context: http://www.nabble.com/appending-to-existing-HTML-tp19836077p19836077.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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


Re: appending to existing HTML

Posted by arj123 <ar...@unnat-e.com>.
Thanks Alex.
I will try this out.

arj


Alexander Daniel wrote:
> 
> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/appending-to-existing-HTML-tp19836077p19850545.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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


Re: appending to existing HTML

Posted by Alexander Daniel <al...@gmx.at>.
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