Re: [PHP-XML-DEV] Lack of configuration support in SAX interface

[email protected] (Derick Rethans) Fri, 9 Sep 2005 08:33:27 +0200 (CEST)
Newsgroups php.xml.dev
Message-ID <Pine.LNX.4.62.0509090833071.3692@localhost>
On Thu, 8 Sep 2005, Rob Richards wrote:

> Jirka Kosek wrote:
> 
> > is there a way how to configure SAX parser (xml_parser_create) similarly as
> > DOM or SimpleXML? I mean specifying constants like LIBXML_NOENT,
> > LIBXML_DTDLOAD, LIBXML_DTDATTR etc. to control parser behaviour.
> >
> > It seems that default behaviour of SAX parser is quite non-conforming to XML
> > spec, it even doesn't expand references to internal entities. 
> 
> Based on the extensions mentioned I assume this is under PHP 5.x and libxml is
> being used for the xml extension. It was designed for compatibility with the
> one under PHP 4 that used expat so behavior in 5 was based on behavior from 4.
> For example, expanding entity refs requires that no default handler is
> defined. In the event its an internal pre-defined entity, they only are not
> expanded when no character data handler is present.
> 
> So to answer your initial question, no, there is not a way to currently do
> this while also keeping compatibility between libxml2 and expat.
> For this type of control you might want to look at xmlreader (though uses its
> own constants to control behavior and is not event based).

I'd say we drop expat compatibility in PHP 6.0 so that we can do things 
correctly...

Derick
-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org