PHP XHTML-validation problem 2

PHP XHTML-validation problem 2

by Anders Berggren -
Number of replies: 9

Hi,

When trying to XHTML-validate lesson/import.html (in the Swedish translation) I get this:

This page is not Valid XHTML 1.0 Transitional!

Below are the results of attempting to parse this document with an SGML parser.

1.      Line 35, column 56: cannot generate system identifier for general entity "module"

... href="help.php?file=formatgift.html&module=quiz">Mer info om "GIFT"-formatet

An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (;). The most common cause of this error is unencoded ampersands in URLs as described by the WDG in "Ampersands in URLs".

Entity references start with an ampersand (&) and end with a semicolon (;). If you want to use a literal ampersand in your document you must encode it as "&" (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and æ are different characters.

Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.

2.      Line 35, column 56: general entity "module" not defined and no default entity

... href="help.php?file=formatgift.html&module=quiz">Mer info om "GIFT"-formatet

This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text. See the previous message for further details.

1.      Line 35, column 62: reference not terminated by REFC delimiter

..."help.php?file=formatgift.html&module=quiz">Mer info om "GIFT"-formatet</a><.

If you meant to include an entity that starts with "&", then you should terminate it with ";". Another reason for this error message is that you inadvertently created an entity by failing to escape an "&" character just before this text.

 

Here is the type of code that causes the validation problems:

 

<a href="help.php?file=formatgift.html&module=quiz">Mer info om "GIFT"-formatet</a>

 

What to do?

 

Anders B

Average of ratings: -
In reply to Anders Berggren

Re: PHP XHTML-validation problem 2

by David Scotson -

Replace each occurance of & (an ampersand) with it's encoded equivalent &amp; so

<a href="help.php?file=formatgift.html&module=quiz">Mer info om "GIFT"-formatet</a>

becomes

<a href="help.php?file=formatgift.html&amp;module=quiz">Mer info om "GIFT"-formatet</a>
In reply to David Scotson

Svar: Re: PHP XHTML-validation problem 2

by Anders Berggren -
Hi,
I followed your advice and as far as I can see
everything works just fine. I am familiar with
XHTML but not with PHP so I don't want experiment
with the PHP-code without knowing what I am doing.
Thanks!
Anders
In reply to Anders Berggren

Re: Svar: Re: PHP XHTML-validation problem 2

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Hi Anders,

I'm running (crawling is more like it) trough all the language files, trying to get the files as xhtml compliant as I can.  When I'm done, I hope most of the problems are solved.
I work in alphabetical order - currently I'm working on el, so Swedish is still far away smile

Feel absolutely free to commit your changes big grin

I didn't know about the valign - I'm going to do some studying / testing and remove or replace it if necessary wiht something else. Thanks for pointing this out!
In reply to koen roggemans

Svar: Re: Svar: Re: PHP XHTML-validation problem 2

by Anders Berggren -
Hi Koen,
Are you validating all of the files of all languages in lang? I am soon done
with this for lang/sv. I will check it in before 1.5 stable is released.
I would have thought that every translator should do this for his/her
langugage? If you need help then suggest some lang(s) that I could validate.
Nothing like kyrillic or Chinese or something else that I don't master though.
Cheers, Anders
In reply to Anders Berggren

Re: Svar: Re: Svar: Re: PHP XHTML-validation problem 2

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Yes, it's quit a job (approx 10700 files).
I was done fixing dutch and saw nothing much happening in a lot of other languages, so I started doing them one by one.
I'll never get this done before 1.5 (unless everyone will be very patient and wait for me big grin ), but what's done is done.

From time to time I notice Imissed something (like the valign-thing) and then I rework them again.

Most of the languages are no problem when working wiht a good editor with syntaxhighlighting - it is (fortunatly) not necessary to read it smile I just had problems with the arab in the moodle language editor because it types from right to left, doing strange things with the backspace etc... I went bananas and gave up on that one.

If you want to help, please do. Just pick a language and notify me and the translator of that language when you start and when you are finished.
Commit reworked files immediately.

This is my worklist (mail says I informed the translator)
af compleet mail
ar help wel / php niet mail
be compleet mail
bg compleet mail
ca compleet mail
cs compleet mail
da compleet mail
de compleet mail
de_du compleet mail
el help\ -> zie datum
en compleet mail
eu compleet mail
hu php mail
nl compleet
In reply to koen roggemans

Re: Svar: Re: Svar: Re: PHP XHTML-validation problem 2

by Nicolas Martignoni -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi,

Anders, please don't choose french, as I'm working on it smile (and it is soon OK or so...)

Cheers
Nicolas
In reply to koen roggemans

Re: Svar: Re: Svar: Re: PHP XHTML-validation problem 2

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
So,

all <img -tags in the lang list above are checked for alt -> alt="", valign is deleted and <img-tags are closed with />

I will continue were I left off (el)
In reply to koen roggemans

Re: Svar: Re: Svar: Re: PHP XHTML-validation problem 2

by Mitsuhiro Yoshida -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Translators
Hello,

Now I'm working for Japanese (ja and ja_utf8). wink
In reply to Mitsuhiro Yoshida

Re: Svar: Re: Svar: Re: PHP XHTML-validation problem 2

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
I've seen it coming in. Thanks a lot !! cool