Re: [PEPr] Comment on XML::XML_FastCreate

From: Date: Mon, 19 Apr 2004 09:29:03 +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-27994@lists.php.net to get a copy of this message
Le lun 19/04/2004 à 11:12, Alan Knowles a écrit : > Comments on comments - havent had time to look at the code yet.. > > > Hi, > > > > I really lik the package, but there are still some issues I have: > > > > 1. HTML attribute > > > >>Specify single attribute with the null value. > >>$x->input(array(type=>'checkbox', checked=>null)) > >>= <input type="checkbox" checked /> > > AFAIK xhtml valid sytnax was checked="checked", html valid is just > 'checked' (without the />) - > I normally use checked=true to indicate that its a attribute without a > value. , and check for === true. Ok, so for XHTML the developper must use 'checked'=>'checked' and 'checked'=>true for HTML > > > > > > > This is not valid, neither in XML nor in XHTML :-( I don't know how to > > solve this, but maybe a flag to switch on HTML (without the X) > > compatibility would be nice. > > the closing /> can sometimes break html - I cant remember the example > of hand, but it does cause havoc sometimes.. Ok, in this case i will apply the advice of Stephan Schmidt to add an option 'html'. When the option is true, the slash of end tag will be removed and the developper could use the 'checked'=>true to return " checked ". If not set (by default) the null/true/false values will returns ""/"1"/"0" > > > 2. Method names > > > >>$x->comment() and other methods > > > > That means, it's not possible to create a tag <comment/>. > > I got no good solution for this problem either :-( Maybe some kind of > > prefixing should be used, using '_' would be great if this would not > > indicate a private method. > > -- just leave it out.. - if you send a string down the line to the > method, I presume it would treat it as raw HTML?? - or does it encode > it... (html escaped would be a good idea, but you could check for > stirngs starting with <!-- .... Developper can use a tag of the name of an internal function with the addXML() method : $x->addXML('comment', (...)) I have an auto-quote options (true by default). If true, we can use the noquote() method to not quote a special string (it use by the comment(), so the comment is not quoted like the XML standard). If false, we can use the quote() method to quote a string(). Thanks, Regards,

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