Re[2]: Entity parsing
Brought to you by:
bs_php,
nigelswinson
From: Sam B. <bs...@us...> - 2002-05-24 09:43:41
|
Hi Peter, > To take a simple example: if you define the following at the front of your > xml file <!ENTITY ourname "Perfect Programmers"> then you can > reference &ourname; in the rest of the file Yes, I know about the that feature. But it has 2 sides. 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! After the XML has been parsed (and maybe modified by one of the included DOM functions) you wouldn't want this to happen when exporting to an XML-file. Note that the expat parser replaces the 5 xml entities plus all the entities that are defined by <!ENTITY ...> 'silently'. I see no simple solution to this problem and therefore I believe the way we handle it, be keeping the entities 'as is', is the best we can do. Regards -- Sam Blum <bs...@us...> =========================== For the most recent version of PHP.XPath and an archive of this list visit: http://sourceforge.net/projects/phpxpath |