Re: [xml] parsing from a file descriptor



On Sat, Sep 07, 2002 at 10:06:21PM -0300, Ricardo Quesada wrote:
Hi,
      I know how to parse a file, using:
              xmlParseFile( filename ), xmlDocGetRootElement(), etc.

      But, now I would like to parse xml from a file descriptor (a socket).

      Should I use:

              xmlParserInputBufferCreateFd(),

 yes

              xmlParserInputBufferRead()

  no, read are done by the parser !

      and then create document using xmlParseMemory() ?

  no !

      or which is the best way to parse xml from an fd ?

  xmlParserInputBufferCreateFd()
  xmlNewParserCtxt()
  xmlNewIOInputStream()
  xmlPushInput()
  and 
  xmlParseDocument()


or use directly
  xmlCreateIOParserCtxt()
  read xmllint.c it uses it.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.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]