Validator fails on PHP instructions inside attribute values

What follows is the output of a validation session.  The validator seems to cope fine with php PIs other than inside attribute values.  Please recognise these as PIs and allow the file to be validated.


   1.   Warning  Line 28, Column 13: character "<" is the first character of a delimiter but occurred as data

      <html lang="<?php echo $clang;?>" xml:lang="<?php echo $clang;?>" xmlns="http:/…

      ✉

      This message may appear in several cases:
          * You tried to include the "<" character in your page: you should escape it as "&lt;"
          * You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&amp;", which is always safe.
          * Another possibility is that you forgot to close quotes in a previous tag.
   2. Error Line 28, Column 13: character "<" is not allowed in the value of attribute "lang"

      <html lang="<?php echo $clang;?>" xml:lang="<?php echo $clang;?>" xmlns="http:/…

      ✉

      It is possible that you violated the naming convention for this attribute. For example, id and name attributes must begin with a letter, not a digit.
   3. Error Line 28, Column 18: value of attribute "lang" must be a single token

      <html lang="<?php echo $clang;?>" xml:lang="<?php echo $clang;?>" xmlns="http:/…

      ✉

      This attribute can not take a space-separated list of words as a value, but only one word ("token"). This may also be caused by the use of a space for the value of an attribute which does not permit it.
   4. Error Line 28, Column 24: character "$" is not allowed in the value of attribute "lang"

      <html lang="<?php echo $clang;?>" xml:lang="<?php echo $clang;?>" xmlns="http:/…

      ✉

      It is possible that you violated the naming convention for this attribute. For example, id and name attributes must begin with a letter, not a digit.
   5. Warning Line 28, Column 45: character "<" is the first character of a delimiter but occurred as data

      …lang="<?php echo $clang;?>" xml:lang="<?php echo $clang;?>" xmlns="http://www.…

      ✉

      This message may appear in several cases:
          * You tried to include the "<" character in your page: you should escape it as "&lt;"
          * You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&amp;", which is always safe.
          * Another possibility is that you forgot to close quotes in a previous tag.
   6. Error Line 28, Column 45: character "<" is not allowed in the value of attribute "xml:lang"

      …lang="<?php echo $clang;?>" xml:lang="<?php echo $clang;?>" xmlns="http://www.…

      ✉

      It is possible that you violated the naming convention for this attribute. For example, id and name attributes must begin with a letter, not a digit.
   7. Error Line 28, Column 50: value of attribute "xml:lang" must be a single token

      …"<?php echo $clang;?>" xml:lang="<?php echo $clang;?>" xmlns="http://www.w3.or…

      ✉

      This attribute can not take a space-separated list of words as a value, but only one word ("token"). This may also be caused by the use of a space for the value of an attribute which does not permit it.
   8. Error Line 28, Column 56: character "$" is not allowed in the value of attribute "xml:lang"

      … echo $clang;?>" xml:lang="<?php echo $clang;?>" xmlns="http://www.w3.org/1999…

      ✉

      It is possible that you violated the naming convention for this attribute. For example, id and name attributes must begin with a letter, not a digit.

============
Richard Ishida
Internationalization Lead
W3C (World Wide Web Consortium)

http://www.w3.org/International/
http://rishida.net/

Received on Monday, 19 July 2010 12:18:14 UTC