1 # Due to a shocking number of bugs and incompatibilities between PyXML and 4Suite,
2 # this actually seems to be the easiest way to convert a XML document to HTML!
5 from xml
.dom
.html
import HTMLDocument
6 from Ft
.Xml
.cDomlette
import implementation
7 from Ft
.Xml
.Xslt
.Processor
import Processor
8 from Ft
.Xml
import InputSource
9 doc
= implementation
.createDocument(None, 'root', None)
11 from cStringIO
import StringIO
13 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
14 <xsl:output method="html"/>
16 <xsl:template match='@*|node()'>
18 <xsl:apply-templates select='@*|node()'/>
24 proc
.appendStylesheet(InputSource
.InputSource(stream
))
27 return proc
.runNode(doc
, None, ignorePis
= 1)