Re: [xml] xmlDocDump will lost some part




I use xmlReadMemory now, it's ok.Thanks.


2008/3/27, Daniel Veillard <veillard redhat com>:
On Thu, Mar 27, 2008 at 12:02:02PM +0800, 高攀 wrote:
> Hi everybody!
>
> I'm a newbie of libxml2.I meet a strange problem.I post them below as html
> format,and I attach the project to save the time of yours.


Read the doc !
   http://xmlsoft.org/xmlreader.html


>      if((1 != xmlTextReaderRead(reader))
>         || !(doc = xmlTextReaderCurrentDoc(reader)))
>      {
>           printf("create doc failed\n");
>           exit(0);
>      }
>
>      xmlDocDump(stdout,doc);


  You completely misunderstood. The reader is a streaming API it
does NOT load the full document at once. your doc is a truncated part of
the full document, so what you get by printing it is an unspecified
subset.


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]