RE: [xml] Parsing given a file handler




-----Original Message-----
From: David Meyer [mailto:david meyer ci tuwien ac at]
Sent: Thursday, October 18, 2001 5:25 PM
To: Henke, Markus
Cc: 'xml gnome org'
Subject: 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?

To tell the truth: I don't know.
I'm using the I/O parser context approach coz i've to use
customized read callbacks, so the "push"-method isn't an
option for me (AFAIK...)

-d


"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)?
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>>

-- 
      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]