Hello,

Here is the piece of code.


  // List of entities to be converted.
  //
  // This array contains a list of entities to be converted when an XPath
  // expression is evaluated.
  //
  // ### People seem to think that &apos is a bad idea for charset ISO-8859-1 
  //var $entities = array ( "&" => "&amp;", "<" => "&lt;", ">" => "&gt;",
  //    "'" => "&apos;", '"' => "&quot;" );
  var $entities = array('&'=>'&amp;', '<'=>'&lt;', '>'=>'&gt;', '"'=>'&quot;');
  

That means that if I do

[....]<!CDATA[[<p>Hello world</p>]]>[...]

The rendering will be

&lt;p&gt;Hello world&lt;/p&gt;

And the browser will display 

<p>Hello world</p>

The easiest (but probably not the safiest) solution is to emplty $entities, I 
have no problem with that because until now I use xml.php/xpath.class.php to 
read XML files not to produce XML files, but I suppose that emptying $entities 
is a bad thing to do when it comes to output XML.

Luc

En réponse à [EMAIL PROTECTED]:

> Hello,
> 
> With xml.php to have a correct rendering of HTML enclosed in XML tags
> (in CDATA 
> sections) the array entities () might be emptied. If it was not the case
> the 
> HTML entities where converted and then displayed by the browser in their
> 
> literal form.
> 
> It seem to be the same with xpath.class.php
> 
> I’m not in front of my development computer so I can’t check the 
> xpath.class.php but the result shows that the behavior is the same.
> 
> Instead of letting the user empty the array containing entities to
> translate, 
> perhaps it would be a good thing to have a property to set (TRUE or
> FALSE) 
> depending the behavior we need/want.
> 
> 
> To go back to my test bed site :-)
> 
> In the following example both the paragraph displayed in the center of
> the 
> screen and the contextual menu in the left block came form the same XML
> file.
> 
> Here is the xml.php version with entities() emptied :
> http://www.interpasnet.com/xmlprocess.php?
> screen=cvs&section=wincvs&file=cvs.xml&id=1
> HTML rendering is OK
> 
> Here is the xpath.class.php version
> http://www.interpasnet.com/xmlprocess.xpath.php?
> screen=cvs&section=wincvs&file=cvs.xml&id=1
> HTML entities contained in CDATA sections are converted so the browser
> displays 
> them in their literal form
> 
> 
> Luc
> 
> --
> This message has been sent through the <phpXML/> user discussion list.
> To unsubscribe, please visit
> https:[EMAIL PROTECTED]/
> 
--
This message has been sent through the <phpXML/> user discussion list. To unsubscribe, 
please visit https:[EMAIL PROTECTED]/

_______________________________________________
Phpxmldb-phpxml-arc mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/phpxmldb-phpxml-arc

Reply via email to