Re: [PEPr] Comment on XML::XML_FastCreate

From: Date: Sat, 10 Apr 2004 08:16:24 +0000
Subject: Re: [PEPr] Comment on XML::XML_FastCreate
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-27366@lists.php.net to get a copy of this message
Hi,
This should be optional - The compact design of the current class is part of the beauty of it. So you prefer a compact class over valid XML?
Try using an attribute with value "PEAR&PECL", this will result in invalid HTML. Maybe you know that entities must be used, but a lot of novice users do not know this. I've been developing a lot of XML-related packages for PEAR (and other repositories) and I know that users have problems with XML from the feedback I get. Even PEAR::Config had this problem and Betrand fixed it by using XML_Util, so he does not have to worry about it...
- just had a quick look at XML_Util - it has alot of very redundant methods.. for example: getXMLDeclaration getDocTypeDeclaration writing the sprintf manually 99% of the time would be alot clearer than using these methods.. Again I disagree, this also allows novice users to build a correct XML declaration, etc.
createTag is probably one of the worst API's i've seen in pear.. - it has 8 arguments - If I see some code using this, I wont have a clue what it might be trying to do.... everything after the content should be a options array.. Then why don't you use createTagFromArray()?
I know that you are a fan of methods that accept one array as parameter, but a lot of people are not. So XML_Util provides methods for both variations.
I'd like to see a PHP version - but it needs a proper HTML parser, - the tidy extension might be an option. but I dont have a problem with the perl script being left in - with a note saying - 'it would be nice to replace this with a php version' added :) It could optionally also use XML_HTMLSax.
Stephan

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