Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-17698

Help files (en_utf8) do not comply with XHTML 1.0 Strict

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.3
    • Fix Version/s: 1.9.8
    • Component/s: Accessibility
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      Help files (at least en_utf8) that do not comply with XHTML 1.0 Strict and the first error found for each file:

      127.0.0.1/moodle/help.php?file=reading.html:124:37:3086136980.65:E: document type does not allow element "p" here; missing one of "object", "ins", "del", "map", "button" start-tag
      127.0.0.1/moodle/help.php?file=text.html:123:32:3085817492.108:E: there is no attribute "align"
      127.0.0.1/moodle/help.php?module=wiki&file=howtowiki.html:118:66:3086960276.108:E: there is no attribute "target"
      127.0.0.1/moodle/help.php?module=data&file=usepreset.html:112:95:3087222420.108:E: there is no attribute "align"
      127.0.0.1/moodle/help.php?module=data&file=participants.html:112:95:3087009428.108:E: there is no attribute "align"
      127.0.0.1/moodle/help.php?module=moodle&file=textformat.html:137:4:3087730324.79:E: end tag for element "ul" which is not open
      127.0.0.1/moodle/help.php?module=wiki&file=htmlmode.html:115:3:3087165076.65:E: document type does not allow element "dl" here; missing one of "object", "ins", "del", "map", "button" start-tag
      127.0.0.1/moodle/help.php?module=data&file=savepreset.html:112:95:3087554196.108:E: there is no attribute "align"
      127.0.0.1/moodle/help.php?module=data&file=fields.html:112:95:3087738516.108:E: there is no attribute "align"
      127.0.0.1/moodle/help.php?file=participantswithselectedusers.html:113:9:3086415508.108:E: there is no attribute "align"
      127.0.0.1/moodle/help.php?module=resource&file=window.html:127:4:3086124692.65:E: document type does not allow element "b" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

        Gliffy Diagrams

        1. language.log
          280 kB
          David Horat
        2. moodle-xhtml-checker-0.1.tar.gz
          387 kB
          David Horat

          Issue Links

            Activity

            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Assigning to Helen... could you, plz, take a look to all those help files and make them to validate properly? TIA!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Assigning to Helen... could you, plz, take a look to all those help files and make them to validate properly? TIA!
            Hide
            daniss Daniele Cordella added a comment -

            Helen and David
            I tried to correct the help files in italian but I noticed that only by changing
            '<P ' to '<p '
            '</P>' to '</p>'
            'align=center' to 'align="center"'
            'ALIGN=CENTER' to 'align="center"'
            '<FONT' to '<font
            '</FONT>' to '</font>
            '<B>' to '<b>' or, better, '<strong>'
            '</B>' to '</b>' or, better, '</strong>', most of the problems left.
            Maybe it can be of help a bulk substitution in all moodledata/lang.
            Hoping this may be of help for Moodle. Merry Xmas.

            Show
            daniss Daniele Cordella added a comment - Helen and David I tried to correct the help files in italian but I noticed that only by changing '<P ' to '<p ' '</P>' to '</p>' 'align=center' to 'align="center"' 'ALIGN=CENTER' to 'align="center"' '<FONT' to '<font '</FONT>' to '</font> '<B>' to '<b>' or, better, '<strong>' '</B>' to '</b>' or, better, '</strong>', most of the problems left. Maybe it can be of help a bulk substitution in all moodledata/lang. Hoping this may be of help for Moodle. Merry Xmas.
            Hide
            david.horat David Horat added a comment -

            Hello Daniele,

            Thank you very much for your effort. I think that this issue should be check manually for all help files in all languages. The current problem is that we can not automate the process of correcting the file because of several reasons:

            • Using automatic replacement should be avoided because "<P" could be in other contexts, so it should be checked manually.
            • Using automatic html to xhtml apps should be avoided because the code is not complete and it has also some errors

            The most common mistakes I have found in help files are:

            • Capitalization of elements and attributes. <P ID="hola"> should be <p id="hola">
            • Use of quotes avoided. <p id=hola> should be <p id="hola">
            • Use of stylistic elements: <b> should not be used but <strong> and <i> should not be used but <em>
            • Not closing tags: in XHTML all tags must be closed. Example: <p>Hello should be <p>Hello</p>
            • Bad closed tags: <p>Hello<p> should be <p>Hello</p>

            But probably there are some more out there ...

            To make your work easier you can use the W3C Validator:
            http://validator.w3.org/#validate_by_input+with_options

            Be sure to specify the option "Validate HTML Fragment" to XHTML 1.0

            Show
            david.horat David Horat added a comment - Hello Daniele, Thank you very much for your effort. I think that this issue should be check manually for all help files in all languages. The current problem is that we can not automate the process of correcting the file because of several reasons: Using automatic replacement should be avoided because "<P" could be in other contexts, so it should be checked manually. Using automatic html to xhtml apps should be avoided because the code is not complete and it has also some errors The most common mistakes I have found in help files are: Capitalization of elements and attributes. <P ID="hola"> should be <p id="hola"> Use of quotes avoided. <p id=hola> should be <p id="hola"> Use of stylistic elements: <b> should not be used but <strong> and <i> should not be used but <em> Not closing tags: in XHTML all tags must be closed. Example: <p>Hello should be <p>Hello</p> Bad closed tags: <p>Hello<p> should be <p>Hello</p> But probably there are some more out there ... To make your work easier you can use the W3C Validator: http://validator.w3.org/#validate_by_input+with_options Be sure to specify the option "Validate HTML Fragment" to XHTML 1.0
            Hide
            tsala Helen Foster added a comment -

            David, thanks for reporting this issue, and Daniele, thanks for your comments

            Adding Koen as a watcher for advice on how best to ensure help files in all languages validate.

            Show
            tsala Helen Foster added a comment - David, thanks for reporting this issue, and Daniele, thanks for your comments Adding Koen as a watcher for advice on how best to ensure help files in all languages validate.
            Hide
            koen Koen Roggemans added a comment -

            I'm afraid it should be done manually. It's a little bit sad this problem crops up again - I went through the all the language packs somewhere around 1.5 or 1.6 I think. Very time consuming.

            Show
            koen Koen Roggemans added a comment - I'm afraid it should be done manually. It's a little bit sad this problem crops up again - I went through the all the language packs somewhere around 1.5 or 1.6 I think. Very time consuming.
            Hide
            david.horat David Horat added a comment -

            Initial report with all the language help files that do not comply with XHTML 1.0 Strict. It seems that the problem is all around.

            Show
            david.horat David Horat added a comment - Initial report with all the language help files that do not comply with XHTML 1.0 Strict. It seems that the problem is all around.
            Hide
            koen Koen Roggemans added a comment -

            hm, 7000 problematic files. That's a lot.
            Can I ask you how you created the list?

            Show
            koen Koen Roggemans added a comment - hm, 7000 problematic files. That's a lot. Can I ask you how you created the list?
            Hide
            david.horat David Horat added a comment -

            Yes. I created a bash script that checkouts out all CVS language files from es.cvs.moodle.org/cvsroot/moodle/lang/, for each individual file I reconstruct it as a whole valid XHTML file, adding header(DOCTYPE, html, header, body) and footer(body, html), I parse them with OpenSP (http://openjade.sourceforge.net/) which is the engine behind the W3C Validator (http://validator.w3.org/) and at the end I use sed to make up the final report with all the pages that are not valid.

            If you want I could work on it a bit more, wrap all needed things up and upload them here.

            Show
            david.horat David Horat added a comment - Yes. I created a bash script that checkouts out all CVS language files from es.cvs.moodle.org/cvsroot/moodle/lang/, for each individual file I reconstruct it as a whole valid XHTML file, adding header(DOCTYPE, html, header, body) and footer(body, html), I parse them with OpenSP ( http://openjade.sourceforge.net/ ) which is the engine behind the W3C Validator ( http://validator.w3.org/ ) and at the end I use sed to make up the final report with all the pages that are not valid. If you want I could work on it a bit more, wrap all needed things up and upload them here.
            Hide
            david.horat David Horat added a comment - - edited

            Report with one non-valid help file per line. No extra numbers at the end.

            Show
            david.horat David Horat added a comment - - edited Report with one non-valid help file per line. No extra numbers at the end.
            Hide
            david.horat David Horat added a comment -

            Hi Koen and all,

            Here is the script I did. Give it a try if you want.
            You can start by reading the README file.
            The scripts is: moodle-xhtml-checker.sh

            Regards,
            David

            Show
            david.horat David Horat added a comment - Hi Koen and all, Here is the script I did. Give it a try if you want. You can start by reading the README file. The scripts is: moodle-xhtml-checker.sh Regards, David
            Hide
            daniss Daniele Cordella added a comment -

            Ciao David and thanks for your script.
            I tried to use it but I fall into:
            quit 2 'onsgmls file not found. Please install it from your repository.'

            I added:
            myStartingFolder=`echo $0 | sed -e "s#^[^/]#\`pwd\`/&#"`
            myStartingFolder=`dirname $myStartingFolder`
            just after your row 36

            and I changed
            your row 47 from:
            if [ ! -x "/usr/bin/onsgmls" ] && [ ! -x "onsgmls" ]; then
            to:
            if [ ! -x "/usr/bin/onsgmls" ] && [ ! -x "$myStartingFolder/onsgmls" ]; then

            Whay your script is working to your computer and not to mine?
            Are there settings I have to set?

            Show
            daniss Daniele Cordella added a comment - Ciao David and thanks for your script. I tried to use it but I fall into: quit 2 'onsgmls file not found. Please install it from your repository.' I added: myStartingFolder=`echo $0 | sed -e "s#^ [^/] #\`pwd\`/&#"` myStartingFolder=`dirname $myStartingFolder` just after your row 36 and I changed your row 47 from: if [ ! -x "/usr/bin/onsgmls" ] && [ ! -x "onsgmls" ]; then to: if [ ! -x "/usr/bin/onsgmls" ] && [ ! -x "$myStartingFolder/onsgmls" ]; then Whay your script is working to your computer and not to mine? Are there settings I have to set?
            Hide
            koen Koen Roggemans added a comment -

            My ubuntu results with about 15000 times "onsgmls: error while loading shared libraries: libosp.so.5: cannot open shared object file: No such file or directory " in the log-file.

            Running "sudo apt-get install libosp5" didn't solve it..

            I had a look at the results of the script, looked in the nl_utf8 langpack since I maintain that and found that it will be very hard to fix everything manually. The first file I looked at (survey.html) I don't see anything wrong, the second one, context.html had one </p> to many and missed one </li>...

            I think going through all the language files (manually) to fix them, is a useless job unless we find some way to keep them clean afterwards. Some script that validates on saving with the language pack editor may be? There are not that many different tags used in the help files.

            Show
            koen Koen Roggemans added a comment - My ubuntu results with about 15000 times "onsgmls: error while loading shared libraries: libosp.so.5: cannot open shared object file: No such file or directory " in the log-file. Running "sudo apt-get install libosp5" didn't solve it.. I had a look at the results of the script, looked in the nl_utf8 langpack since I maintain that and found that it will be very hard to fix everything manually. The first file I looked at (survey.html) I don't see anything wrong, the second one, context.html had one </p> to many and missed one </li>... I think going through all the language files (manually) to fix them, is a useless job unless we find some way to keep them clean afterwards. Some script that validates on saving with the language pack editor may be? There are not that many different tags used in the help files.
            Hide
            koen Koen Roggemans added a comment -

            running apt-get install w3c-dtd-xhtml got me a little bit further. I get now

            onsgmls:lang/af_utf8/help/courseformats.html:5:28:E: end tag for element "b" which is not open
            onsgmls:I: maximum number of errors (1) reached; change with -E option

            Show
            koen Koen Roggemans added a comment - running apt-get install w3c-dtd-xhtml got me a little bit further. I get now onsgmls:lang/af_utf8/help/courseformats.html:5:28:E: end tag for element "b" which is not open onsgmls:I: maximum number of errors (1) reached; change with -E option
            Hide
            tsala Helen Foster added a comment -

            David, thanks for your report and apologies for the long delay in fixing the issue.

            The following files are fixed in 1.9 only: reading.html, text.html, howtowiki.html, htmlmode.html
            (The reason why I have not fixed the files in HEAD is because my recommendation is to delete them as part of the en language pack cleanup.)

            The following files are fixed in 1.9 and HEAD: usepreset.html, participants.html, savepreset.html, fields.html participantswithselectedusers.html, window.html

            Everyone, thanks for your interesting comments. If necessary, please create new issues for points raised.

            Show
            tsala Helen Foster added a comment - David, thanks for your report and apologies for the long delay in fixing the issue. The following files are fixed in 1.9 only: reading.html, text.html, howtowiki.html, htmlmode.html (The reason why I have not fixed the files in HEAD is because my recommendation is to delete them as part of the en language pack cleanup.) The following files are fixed in 1.9 and HEAD: usepreset.html, participants.html, savepreset.html, fields.html participantswithselectedusers.html, window.html Everyone, thanks for your interesting comments. If necessary, please create new issues for points raised.
            Hide
            david.horat David Horat added a comment -

            Thank you Helen.

            Show
            david.horat David Horat added a comment - Thank you Helen.

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  25/Mar/10