[phpwebapp-commits] CVS: web_app/doc to_do.txt,1.6,1.7 changes.txt,1.6,1.7
Brought to you by:
dashohoxha
From: Dashamir H. <das...@us...> - 2004-07-16 14:45:23
|
Update of /cvsroot/phpwebapp/web_app/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27618/doc Modified Files: to_do.txt changes.txt Log Message: Index: to_do.txt =================================================================== RCS file: /cvsroot/phpwebapp/web_app/doc/to_do.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** to_do.txt 16 Jul 2004 07:37:05 -0000 1.6 --- to_do.txt 16 Jul 2004 14:45:14 -0000 1.7 *************** *** 1,11 **** - * Parse the templates using an XML parser. - - - Use 'tidy' or any shell scripts for converting from HTML to XHTML. - After this, use an XSLT transformer to reformat the templates - properly. - This script should convert tags like <br>, <hr>, <input> etc. - to <br/>, <hr/>, <input/> etc. Some other things that may need - to be converted are: <li>, <option>, checked, nowrap, , - <img>, etc. - Use the new framework with the other web applications (app1, --- 1,2 ---- *************** *** 20,21 **** --- 11,50 ---- - Make a new release of phpwebapp that includes the latest changes in the parser any improvments in the docs, etc. + + ---------------------------------------------------------------------- + + * When switching an existing web application to the new version + of the framework (with the xml parser), these modifications + need to be done to the templates: + + 1 - Find and remove all <Header> and <Footer> tags and place their + contents outside the <Repeat> element. In case that the + recordset of the <Repeat> is a paged recordset and page variables + ({{PrevPage}}, {{NextPage}} etc.) are used for navigation, + then put the navigation part of the template inside the element + <RSNavig>. + + 2 - Replace 'not-equal operator' <> by !=, in the condition of <If> + elements: <If condition="'{{CurrPage}}'<>'{{PrevPage}}'"> + This can be done automatically by a script. + + 3 - Replace the old usage of 'checked' in checkboxes with the new + usage; replace {{checked_var}} with checked="{{checked_var}}". + Do the same for the 'selected' attribute of the listboxes: + replace {{selected_var}} with selected="{{selected_var}}" + + 4 - Use 'tidy' (with some appropriate options) to convert all the + templates to clean XHTML code (convert all tags and attributes + to lowercase, replace <img...> by <img ... />, etc.). + A script would be usefull for this. + + 5 - In case that some formating of tidy is not satisfactory, then + use an XSLT transformer(stylesheet) and xsltproc to convert + the templates to a better formating. + + 6 - Add these lines at the beginning of the root templates: + <?xml version="1.0" encoding="iso-8859-1"?> + <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml" lang="EN"> + Index: changes.txt =================================================================== RCS file: /cvsroot/phpwebapp/web_app/doc/changes.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** changes.txt 16 Jul 2004 07:37:06 -0000 1.6 --- changes.txt 16 Jul 2004 14:45:14 -0000 1.7 *************** *** 31,42 **** ------------------------------------------------------------------- * <Repeat> syntax changed. There was a problem with the <Header>/<Footer> tags, because the contents of the <Header> usually is not well-formed xml and ! it breaks the xml parsing. E.g. it may be something like this: <repeat rs="rs_id"> <header> ! <table> </header> <tr><td>{{xyz}}</td></tr> --- 31,61 ---- ------------------------------------------------------------------- + * The main (root) template should start like this: + + <?xml version="1.0" encoding="iso-8859-1"?> + <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml" lang="EN"> + + because if no DOCTYPE is defined, the parser will have problems + with reckognizing entities ( & etc.), and there may + be any other problems as well. + + For the other templates, however, these headers shoud not be + added, because the parser will add them automatically to them, + so that they become well-formed xml and are parsed successfully. + The headers that will be added to the other templates will be + a copy of the headers of the main template. + + ------------------------------------------------------------------- + * <Repeat> syntax changed. There was a problem with the <Header>/<Footer> tags, because the contents of the <Header> usually is not well-formed xml and ! it breaks the parser. E.g. it may be something like this: <repeat rs="rs_id"> <header> ! <table> <---- not well-formed XML </header> <tr><td>{{xyz}}</td></tr> *************** *** 63,66 **** --- 82,123 ---- ------------------------------------------------------------------- + * This is wrong: <If condition="'{{CurrPage}}'<>'{{PrevPage}}'"> + This is right: <If condition="'{{CurrPage}}'!='{{PrevPage}}'"> + because the xml parser complains about the characters < and > + inside the value of an attribute. + + ------------------------------------------------------------------- + + * In order to put a check in a checkbox according to the value of + some state variable, framework used something like this: + <input type="checkbox" name="all_books" {{all_books}} + onclick="set_chkbox(this)> + where the variable {{all_books}} has a value of 'checked' or ''. + + This is not well-formed XHTML and it breaks the xml parser, + because, instead of {{all_books}} the parser expects an attribute + name and value. + + In XHTML this attribute should be used like this: checked="checked". + However, doing it like this: + <input type="checkbox" name="all_books" checked="{{all_books}}" + onclick="set_chkbox(this)> + would not solve the problem, because the browser will check the + checkbox no matter what is the value of the checked attribute; + the presense of the 'checked' attribute is enough for the browser + to check the checkbox. + + In order to solve this problem, the framework, when it renders the + HTML page, replaces 'checked=""' with empty (removes it). + It also removes: checked="no" and checked="false". On the other hand, + it replaces checked="yes" and checked="true" by checked="checked", + so that the output complies with XHTML. + + The same thing is done for: selected="selected", selected="", + selected="yes", selected="no", selected="true" and selected="false". + + ------------------------------------------------------------------- + ------------------------------------------------------------------- + * Added the tag <example>. It can be used like this: *************** *** 90,102 **** ------------------------------------------------------------------- - * - This is wrong: <If condition="'{{CurrPage}}'<>'{{PrevPage}}'"> - This is right: <If condition="'{{CurrPage}}'!='{{PrevPage}}'"> - because the xml parser complains about the characters < and > - inside the value of an attribute. - - ------------------------------------------------------------------- - - ------------------------------------------------------------------- - ------------------------------------------------------------------- - ------------------------------------------------------------------- ------------------------------------------------------------------- --- 147,149 ---- |