HTMLTransformer output

This XML file contains HTML code with escaped markup: tags are written like &lt;body/&gt; with escaped < and > signs. This is often the case with RSS feeds.

In this example, the HTMLTransformer is configured to parse the contents of the <description> and <escaped-html>, elements, creating well-formed content from this escaped markup.

A downstream transform is used to filter the result, as the HTMLTransformer writes full HTML documents as <html> elements, for each input element that it parses.

For more info search "HTMLTransformer" in the sitemap that drives this sample.

</head><body xmlns=""><div style="background: #FFFFCC; color: black; margin: 1em;"><h1>Here's some escaped HTML</h1>This test document contains escaped HTML code in the description elements, as is customary in RSS documents for example. <p><img src="http://cocoon.apache.org/2.1/images/cocoon.gif" align="right"/> This description element contains escaped html markup, which should be converted to proper html by the HTMLTransformer. If the Cocoon logo is shown properly, it means that the parsing worked.</p><blockquote>This should be a blockquote and <b>here's some bold</b>.</blockquote>Note that the HTMLTransformer generates a complete HTML document for each element that is parsed - here this is filtered downstream to keep only the contents of the <body> of the parsed documents.</div></body></html></description> </div> <div id="example-2"> <escaped-html><html xmlns="http://www.w3.org/1999/xhtml"><head xmlns=""><meta content="HTML Tidy, see www.w3.org" name="generator"/><title/></head><body xmlns=""><div style="background: #FFFFCC; color: black; margin: 1em;"><h1>More escaped HTML</h1><img src="http://cocoon.apache.org/2.1/images/cocoon.gif" align="right"/> Another description element with escaped html markup, including a Cocoon logo. <p>Here's some <i>italic</i> and a <a href="http://cocoon.apache.org">link to the Cocoon site</a>.</p></div></body></html></escaped-html> </div> </div> </html-transformer-test></body></html>