Re: [xml] htmlReadMemory



On Wed, Jan 26, 2005 at 10:50:39AM -0000, spinmar interfree it wrote:

Hi all,
I have two questions regards to htmlReadMemory.
This function is 

htmlDocPtr    htmlReadMemory (const char * buffer, int size, const char * URL, const char * encoding, int 
options)

I don't understand the meaning of:

URL: the base URL to use for the document

For example if the url is http://arianna.libero.it/ricerca_avanzata.html, what's the base URL?

  http://arianna.libero.it/ricerca_avanzata.html

The second question is about encoding. I have a buffer with my html code: can I pass it to htmlReadMemory 
with encoding=NULL and hope that it automatically discovers the rigth encoding of the page?

  yes

If I use HTML_PARSE_NOERROR | HTML_PARSE_NOWARNING as options, the non well formed errors are suppresed?

  depends how you built your errror layer. Some errors like memory allocation
errors will always be reported anyway.

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]