Re: Re[2]: Entity parsing - continued
Brought to you by:
bs_php,
nigelswinson
From: Peter R. <php...@pe...> - 2002-05-24 12:48:33
|
just been reading up a bit further on expat, and it seems if you do not set a character data handler but let it be handled by the default handler, this has the effect of not parsing/expanding internal entities. Just tested this in php briefly, and it's true. Might this be the way forward (of course it's perfectly possible it might screw something else up!)? Only set a character data handler if you want the entities parsed? It also seems expat can after all handle external DTDs and PEs, but you have to define this when you compile it. I see the latest versions of PHP now have handlers for namespaces, so perhaps they will get around to PEs eventually. On Friday 24 May 2002 11:30, Peter Robins wrote: > On Friday 24 May 2002 10:44, Sam Blum wrote: > > Assuming we would let expat parse the entity in the sample below > > <!ENTITY ourname "Perfect Programmers>"> > > <&ourname; > > > > and would generate a file with one of the export-functions of Php.XPath > > the result would be: > > <!ENTITY ourname "Perfect Programmers>"> > > <Perfect Programmers> > > > > All defined entities (plus the 5 xml entities) have been replaces and any > > changes to <!ENTITY ourname "Perfect Programmers"> in the exported file > > would have *no effect* any more! Even worse the < and > have been > > replaced too! > > ok, so this means if you are importing/parsing in order to change/rewrite > the file, then you don't want entities parsed (treat & as &); if for > outputing to some other medium such as html, then you do. So . . . can we > have it switchable please, passing over a y/n parameter to the import > functions. > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Phpxpath-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpxpath-users |