Re: PHP5, XPath and count()
| From: | Victor Boivie | Date: | Sat, 24 Jul 2004 19:26:58 +0000 |
| Subject: | Re: PHP5, XPath and count() | ||
| References: | 1 2 3 | Groups: | php.xml.dev |
| Request: | Send a blank email to php-xml-dev+get-434@lists.php.net to get a copy of this message | ||
I posted this in php.general, but then I found this newsgroup. Maybe it's more suitable here (?)
$dom = new DOMDocument();
$root = $dom->createElement("test");
$dom->appendChild($root);
$node = $dom->createElement("foo", "which entities <i>does</i> it
escape & which doesn't it?");
$root->appendChild($node);
echo $dom->saveXML();
The result will be:
<?xml version="1.0"?>
<test><foo>which entities <i>does</i> it escape </foo></test>
It stops at the &, which I think is strange. It escapes the < to <
and > to >, but not & to &. It would be better if it escaped none
or all entites that "can do harm".
Or what do you think?
regards,
Victor