PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

XHTML 1.0 Transitional validation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • XHTML 1.0 Transitional validation

    Hello. I am including Zoom/search.php in my search page, which is declared as XHTML 1.0 Transitional. I get lots of validation errors (using http://validator.w3.org/) about the print statements in search.php, like -

    Error Line 20 column 28: an attribute value must be a literal unless it contains only name characters.
    print("<form method=\"get\" ...

    You have used a character that is not considered a "name character" in an attribute value. Which characters are considered "name characters" varies between the different document types, but a good rule of thumb is that unless the value contains only lower or upper case letters in the range a-z you must put quotation marks around the value.
    It's objecting to the backslashes.

    All I can find about XHTML at Wrensoft is a mention in http://www.wrensoft.com/zoom/whatsnew.html about version 4.2.1000 - "Validated XHTML 1.0 Transitional output".

    Is there something else I have to do to get it to validate?

    Thanks!

  • #2
    I'm guessing you uploaded the "search.php" file to the validator.

    If you did that, you're trying to validate the PHP script as a HTML file. Naturally, there would be alot of errors.

    You need to validate the output of the script. You can do this after the script is uploaded to your web server (and working) and you then enter in the URL to the validator. This will then allow the PHP script to execute on your web server, and the output will be validated correctly.

    If you are already doing the latter, then check if your search page is actually working when you access it through the browser and if your server actually supports PHP.
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment


    • #3
      Hello Ray.

      Originally posted by Ray
      I'm guessing you uploaded the "search.php" file to the validator.

      If you did that, you're trying to validate the PHP script as a HTML file. Naturally, there would be alot of errors.

      You need to validate the output of the script. You can do this after the script is uploaded to your web server (and working) and you then enter in the URL to the validator. This will then allow the PHP script to execute on your web server, and the output will be validated correctly.

      If you are already doing the latter, then check if your search page is actually working when you access it through the browser and if your server actually supports PHP.
      Wrong assumption, but worth checking.

      I'm validating the output of the script through a page that works perfectly - http://imago.com.au/New/Search.php. If you run that page through http://validator.w3.org/ you will get about 12 errors of the kind I described (plus a bunch of others that might be relevant) - http://validator.w3.org/check?uri=ht...w%2FSearch.php.

      Comment


      • #4
        I had a look at your page. The problem is not in the default search script.

        You have this bit of code placed in your custom "Search.php" file (I presume it is either a modified version of the script or it is embedding our search.php file):

        Code:
        		<script type="text/javascript">
        			/*	If this stops working, it's probably because Zoom/search.php has lost the name for the form.
        				Zoom/search.php is regenerated from C&#58;\Program Files\Zoom Search\scripts\PHP or ASP\search.php,
        				so make sure that the following line in that file -
        				    print&#40;"<form method=\"get\" action=\"".$SelfURL."\" class=\"zoom_searchform\">\n"&#41;;
        				includes a name attribute, like -
        				    print&#40;"<form method=\"get\" action=\"".$SelfURL."\" class=\"zoom_searchform\" name=\"zoom_form\">\n"&#41;;
        			*/
        			function setInputFocus&#40;&#41; &#123;
        				zoom_form.zoom_query.focus&#40;&#41;;
        			&#125;
        		</script>
        This is where your error is occuring. You should note that /* and */ does not comment out code in HTML, only in Javascript. So the HTML validator would not ignore those lines. Removing those comments you've placed there should fix the problem. Or just wrap them with HTML comment markers (ie. )

        The reason I suspected you uploaded the file before was because the error is reporting on a line of PHP code, and there is no way that PHP code would show through to the validator if the script had been correctly executed.
        --Ray
        Wrensoft Web Software
        Sydney, Australia
        Zoom Search Engine

        Comment


        • #5
          Originally posted by Ray
          The reason I suspected you uploaded the file before was because the error is reporting on a line of PHP code, and there is no way that PHP code would show through to the validator if the script had been correctly executed.
          Aargh! I couldn't work that out either - how could the PHP code be showing through? Thanks mate, you're a master!

          Comment


          • #6
            BTW, all I had to do to get it to validate as XHTML 1.1 was change the name=\"zoom_form\" to id=\"zoom_form\".

            Comment

            Working...
            X