Re: [xml] XML for config files



* Jason Valenzuela wrote:
2. xmlReadMemory() - Read in the DTD from a char[].

This is certainly wrong, the procedure is for XML documents and DTDs are
not XML documents. You have to use, for example, xmlParseDTD() to parse
the DTD.

Are there applications where one should use the reader instead of the 
parser? For example I'm currently using the parser's xmlReadMemory 
instead of xmlReaderForMemory only because xmlNewDtd and xmlValidateDtd 
want doc pointers. Beyond that I'm not sure about the difference between 
the two interfaces.

The reader interface is a stream-oriented interface, you process as you
parse; the parser interface creates in-memory tree structures, you parse
in one go and process later. For very small documents the main concern
should be how you would like to process and manipulate the document.
-- 
Björn Höhrmann · mailto:bjoern hoehrmann de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 



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