Re: XML_Functions

From: Date: Thu, 01 Apr 2004 13:08:27 +0000
Subject: Re: XML_Functions
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-26958@lists.php.net to get a copy of this message
Guillaume Lecanu wrote:
Le mer 31/03/2004 à 16:28, Stephan Schmidt a écrit :
Hi,
This method make a valid XML contents.
It does not in the code you are currently using. You should replace &, <, >, ' and " with their respective entities or use XML_Util to create the tags.
The output is principaly for generating HTML pages but can be used for make an XML file. For make a valid HTML page, i have never heard to replace < > with their entities equivalent.. have you a link about this please ?
Guillaume, You must only EVER have < and > and & in HTML or XML when marking up tags (i.e. <html>) and entities (i.e. &amp;) - failure to do so will create invalid markup. You should therefore HTMLentities() any CDATA (the contents of attributes and tags, i.e. <tag attr="CDATA">CDATA</tag>) Simple reason: How to know that if you have this in the OUTPUT of an HTML or XML page "in this code: $foo < $bar but > $baz" that "< $bar but >" is not an HTML/XML tag? the parse will check it. Additionally, in this: "I shot him & that was that;" how do you know that it's not referenceing the entity "that was that"? - Davey p.s. Make PHP5 a dependency of the package (as it will not run at ALL without it) and the check for "overload" etc is not needed.

« previous php.pear.dev (#26958) next »