Re: simplify DOM api

From: Date: Mon, 06 Mar 2006 13:22:52 +0000
Subject: Re: simplify DOM api
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-231505@lists.php.net to get a copy of this message
Andreas Korthaus wrote:
I think this should be OK, or shouldn't I do it this way? Both ways are perfectly acceptable and all up to personal preference. In fact, to support the way you are doing it was one of the reasons why DOM classes were allowed to be extended.
Perhaps you have seen that I've used a "xml_entity_encode()" function. This function works like htmlspecialchars(), but replaces ' with ' and not '. Or do all of you use htmlspecialchars()? Does it work with Unicode strings? I typically use htmlspecialchars() and remember that you are going to have to work with UTF-8, which is compatible with htmlspecialchars(), when editing a tree.
You can also look at using xmlwriter, when creating serialized trees, that automatically does escaping for you. Rob

« previous php.general (#231505) next »