Re: [xml] DTD attribute completion with SAX parsing



On Fri, Sep 10, 2004 at 09:31:53PM +0200, Varga Andras wrote:

I'd like to parse a document with the SAX API (I want to build a tree
myself), and at the same time I'd like default attributes to be completed
from the DTD supplied in the DOCTYPE of the XML doc, like done by 
xmllint --dtdattr. Is this possible with LibXML, or attribute completion
only works with the tree building parser functions?

I've tried 
    xmlDoValidityCheckingDefaultValue = 1;
    xmlLoadExtDtdDefaultValue |= XML_DETECT_IDS;
    xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS;
    xmlSubstituteEntitiesDefaultValue = 1; 
together with xmlCreatePushParserCtxt() and xmlParseChunk()
and it doesn't seem to work (libxml2-2.5.4.win32).

  you should agregate the options and pass then to the parser creation
context. 2.5.4 is ancient. You also need to use SAXv2 not the SAXv1 
interface (ns callback, XML_SAX2_MAGIC see testSAX.c).

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://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]