Re: [xml] Parsing given a file handler




Meyer, David wrote:

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


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
 See:                          http://www.ordat.com
_____________________________________________________________
              ...this behavior is by design...

 <<Markus Henke.vcf>> 

Attachment: Markus Henke.vcf
Description: Binary data



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