Re: Lack of configuration support in SAX interface
| From: | Derick Rethans | Date: | Fri, 09 Sep 2005 06:33:27 +0000 |
| Subject: | Re: Lack of configuration support in SAX interface | ||
| References: | 1 2 | Groups: | php.xml.dev |
| Request: | Send a blank email to php-xml-dev+get-567@lists.php.net to get a copy of this message | ||
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