Re: Proposal: XML_Util

From: Date: Thu, 31 Jul 2003 20:41:13 +0000
Subject: Re: Proposal: XML_Util
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-19086@lists.php.net to get a copy of this message
Hi Stephan, +1 for the package, I prefer XML_Util. I have a few small notes: @const is unnecessary, phpDocumentor parses constants without help, and will raise a warning of an unknown tag. You should use @static in front of static functions, no arguments just: /** * description, etc. * @param blah * @static */ You're welcome to keep the @access public declarations, but it is unnecessary and you can save typing since that is the assumed visibility (since PHP is access public unless otherwise declared) Enclose example code within a docblock in <code></code> I'd like to see replaceEntities accept as an optional parameter an array so that international entities can be optionally replaced, and things like the copyright symbol as well, just add in an array_merge($entities, $options) and strtr($string, $options). That should resolve the problem I had with it being a static method, as it will be extensible without the need for sub-classing. Regards, Greg Stephan Schmidt wrote:
Hi, I finished the first version of the XML utility class I was talking about. It's currently able to: - replace XML entities in a string - convert an array to an attribute string - build an XML declaration - split a qualified name (xslt:stylesheet) into namespace and local part - validate an XML name (there are rules for tag and attribute names) - create an XML tag The source is available at: http://www.php-tools.de/PEAR/XML_Util/XML_Util.phps And I added a small script that displays all methods: http://www.php-tools.de/PEAR/XML_Util/examples/example.php http://www.php-tools.de/PEAR/XML_Util/examples/example.phps Mainly we just have to decide on the name, the feedback I got is like this: XML_Util : 2
XML        : 1
XML_Common : 1 (but wouldn't object if called XML_Util) I'm in favour of XML, but XML_Util is fine for me. I'd like to release it in 24 hours (got no -1 and several +1) and if no one objects, I'll call it XML_Util. Stephan


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