Re: [xml] Parsing given a file handler

Meanwhile I used the ``push''-method described on the xmlsoft-homepage
(``Invoking the parser'').
Is your method more efficient?


"Henke, Markus" wrote:

Meyer, David wrote:

Is it possible to parse an XML file given a file handler (could be either
stdin or a textfile)?

I think it should be possible to retrieve the filedscriptor

  fd = fileno(filehdl);

and create an I/O-parsercontext

  ctxt = xmlCreateIOParserCtxt(NULL, NULL, readCallback, closeCallback,
(void *) &fd, XML_CHAR_ENCODING_NONE);

(e.g.; see documentation for this...).
Then you can parse

  parseResult = xmlParseDocument(ctxt);

the document.

Hope that helps!

Mit freundlichen Gruessen - Kind regards
Markus Henke

________________________Addressed by:________________________
 ORDAT GmbH & Co. KG  -  Serversystems / eCom
 Dipl.-Inf. (FH) Markus Henke  Fon: +49 (641) 7941-0
 Rathenaustr. 1                Fax: +49 (641) 7941-132
 35394 Gießen                  mailto:markus henke ordat com
              ...this behavior is by design...

 <<Markus Henke.vcf>>

        Mag. David Meyer                Wiedner Hauptstrasse 8-10
Vienna University of Technology         A-1040 Vienna/AUSTRIA
       Department for                   Tel.: (+431) 58801/10772
Statistics and Probability Theory       mail: david meyer ci tuwien ac at

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