Re: [xml] Does libxml parse html like browsers?



On Mon, Mar 14, 2005 at 08:00:10PM -0800, Sebastien Boisvert wrote:
But I need to know if libxml will parse an 'incorrect'
HTML (you know, the usual kind on the net) and build a
tree like browsers do, regardless of those errors (ie.
throwing away whatever's not valid),

  yes, but the best way it to *try* it ! libxml2 does minimal fixups
contrary to Tidy.

Also, is there an example specific to parsing HTML? Or

  xmllint --html code. 

is the procedure the same as for xml with the
xmlXXXXXXX commands replaced with their htmlXXXXXXX equivalents?

  basically yes
  http://xmlsoft.org/html/libxml-HTMLparser.html
  http://xmlsoft.org/html/libxml-HTMLtree.html

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
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]