Re: [xml] Applying XSLT to HTML

On Tue, Jun 19, 2007 at 07:45:41PM +0400, Dmitry Dzhus wrote:

My aim is to apply XSLT to some HTML document (which may be broken
just a little). 

I'm using standard Python libxml2/libxslt bindings.

My code is:

   mf_extract = libxslt.parseStylesheetFile("mf-extract.xsl")
   doc = libxml2.readHtmlFile(url, None, libxml2.HTML_PARSE_RECOVER)
   mf_extract.applyStylesheet(doc, None)

  I don't know what you are doing, but I have been using that for years and
years. Please debug your code a bit, the doc resulting from HTML parsing
of libxml2 are okay for XSLT processing with libxslt. Or just use
xsltproc --html if you can't debug it, it does it directly.


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]