Mercurial > genshi > mirror
diff examples/transform/template.xml @ 107:8b6bd2d920c1 trunk
Add example that shows how to transform an HTML document.
author | cmlenz |
---|---|
date | Fri, 28 Jul 2006 16:52:23 +0000 |
parents | |
children | 2368c3becc52 |
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/examples/transform/template.xml @@ -0,0 +1,22 @@ +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns:py="http://markup.edgewall.org/" py:strip=""> + + <!--! Add a header DIV on top of every page with a logo image --> + <body py:match="body"> + <div id="header"> + <img src="logo.png" alt="Bad Style"/> + </div> + ${select('*')} + </body> + + <!--! Use semantic instead of presentational tags for emphasis --> + <strong py:match="B|b">${select('*|text()')}</strong> + <em py:match="I|i">${select('*|text()')}</em> + + <!--! Include the actual HTML stream, which will be processed by the rules + defined above --> + ${input} + +</html>