Re: [xml] Applying XSLT to HTML



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

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.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



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