W3C home > Mailing lists > Public > www-validator@w3.org > July 2011

Validations Show different Results when done through Javascript and when done by Direct Input on W3C website

From: <chandan.kumar.parmar@accenture.com>
Date: Thu, 21 Jul 2011 19:26:03 +0530
To: <www-validator@w3.org>
CC: <rajesh.soni@accenture.com>, <mahavir.patil@accenture.com>
Message-ID: <86C8188D491A6F448FD5F277C8485A5F0851A4CFF2@INDXM3124.dir.svc.accenture.com>
Hi,

Requirement:
I have a scenario wherein I need to validate some html content placed inside a RadEditor Content Area on a SharePoint Portal Page (Content attached with this email). The content intentionally does not contain  a DocType Declaration.

Issue:
For this I have opted to use W3C validation and called it through javascript as mentioned below:

    var encodedContent = getRadWindow().ClientParameters;                                                                      // This gets the HTML content inside the RadEditor Content Area
    xmlHttp = CreateXMLHttpRequest();                                                                                                                   // Create XMLHttpObject for calling the webservice
    var params = "fragment=" + encodedContent ;                                                                                              // Output the result in HTML format
    xmlHttp.open("POST", "http://validator.w3.org/check", false);
    xmlHttp.setRequestHeader("Content-length", params.length)
    xmlHttp.send(params);
    document.getElementById('mainContentDiv').innerHTML = xmlHttp.responseText;                   // Display the result on the screen.

The resulting screen shows 2 Errors and 2 Warnings (highlighted in Red):
[cid:image002.jpg@01CC47DC.07E66A60]

But when the same content is validated on the W3C website as Direct Input,  1 Error and 4 Warnings are shown (highlighted in brown):
[cid:image006.jpg@01CC47DC.07E66A60]

Rest all the filter criteria remains the same viz. Encoding: UTF-8 and DocType: HTML 4.0.1 Transitional

Please let me know if this is an expected behaviour or a bug. Also please let me know what workaround should be followed to eradicate this issue.

Thanks & Regards,
Chandan Kumar Parmar
Avanade Technology Group
Accenture | Delivery Centres for Technology in India
AIM: aaryan20032003
Mobile: +91 97300 123 25
www.accenture.com<http://www.accenture.com/> | www.avanade.com<http://www.avanade.com/>

________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.





image002.jpg
(image/jpeg attachment: image002.jpg)

image006.jpg
(image/jpeg attachment: image006.jpg)

Received on Saturday, 23 July 2011 15:05:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:48 GMT