Clarification about some errors please

For technical support for all editions of CSS HTML Validator. Includes bug reports.
Post Reply
ajtruckle
Rank II - Novice
Rank II - Novice
Posts: 47
Joined: Sat Feb 27, 2010 1:24 pm

Clarification about some errors please

Post by ajtruckle » Mon Jul 05, 2010 9:57 am

Hello

I have switched off warnings and messages, and run my webhelp through the batch validator (version 10). I fixed many of the issues that it raised. But I am left with a few and I wanted to see if they were chm2web issues or false postives etc..

Here are the errors from the report:

Code: Select all

http://www.publictalksoftware.co.uk/public_talks/HelpOnline/
Line:char	Type	Message Description
24:48	Error	The "script" element cannot be used here. It is not contained in an element that allows its use.

<title>Public Talks Online Help</title></head><script type="text/JavaScript">
 
25:1	Error	Text is contained in a "html" element. Because it is contained here, it must also be contained in one of the following elements: "body" "head" "noframes".

document.write('<frameset rows="30,*" frameborder="yes" framespacing="2" border="0" bordercolor="#85A4C2">');
 
25:18	Error	The "frameset" element cannot be used here. It is contained in a "script" tag that cannot contain it.

document.write('<frameset rows="30,*" frameborder="yes" framespacing="2" border="0" bordercolor="#85A4C2">');
 
25:107	Error	Text is contained in a "html" element. Because it is contained here, it must also be contained in one of the following elements: "body" "head" "noframes".

document.write('<frameset rows="30,*" frameborder="yes" framespacing="2" border="0" bordercolor="#85A4C2">');
 
26:71	Error	Text is contained in a "html" element. Because it is contained here, it must also be contained in one of the following elements: "body" "head" "noframes".

document.write('<frame name="header" src="'+tabs[0]+'" scrolling="no">');
 
27:69	Error	The "frameset" element must directly contain only the following elements: "frameset", "frame". Text is not allowed here.

document.write('<frameset cols="200,*" frameborder="yes" border="4">');
 
27:69	Error	The "frameset" element must directly contain only the following elements: "frameset", "frame", "noframes". Text is not allowed here.

document.write('<frameset cols="200,*" frameborder="yes" border="4">');
 
27:69	Error	Text is contained in a "html" element. Because it is contained here, it must also be contained in one of the following elements: "body" "head" "noframes".

document.write('<frameset cols="200,*" frameborder="yes" border="4">');
 
28:53	Error	The "frameset" element must directly contain only the following elements: "frameset", "frame", "noframes". Text is not allowed here.

document.write('<frame name="toc" src="'+tabs[1]+'">');
 
28:53	Error	Text is contained in a "html" element. Because it is contained here, it must also be contained in one of the following elements: "body" "head" "noframes".

document.write('<frame name="toc" src="'+tabs[1]+'">');
 
29:56	Error	The "frameset" element must directly contain only the following elements: "frameset", "frame", "noframes". Text is not allowed here.

document.write('<frame name="content" src="' + F + '" >');
 
29:56	Error	Text is contained in a "html" element. Because it is contained here, it must also be contained in one of the following elements: "body" "head" "noframes".

document.write('<frame name="content" src="' + F + '" >');
 
30:28	Error	Text is contained in a "html" element. Because it is contained here, it must also be contained in one of the following elements: "body" "head" "noframes".

document.write('</frameset>');
 
31:28	Error	Text is contained in a "html" element. Because it is contained here, it must also be contained in one of the following elements: "body" "head" "noframes".

document.write('</frameset>');
 
34:2	Error	The "noscript" element cannot be used here. It is not contained in an element that allows its use.

<noscript><body><p>To display this page you need a browser with JavaScript support.</p><a href="helpcontents.html">Help contents</a></body></noscript></html>

Finally, I also got these errors:

Code: Select all

Requested "http://www.publictalksoftware.co.uk/public_talks/HelpOnline/helpcontents.html".
Initiated a total of 6 URL downloads.
Waiting for all (if any) HTTP downloads to finish...
An error occurred for the request "http://www.publictalksoftware.co.uk/public_talks/HelpOnline/'+tabs[1]+'". Error: 0, Status: 404, Reason: Not Found. This target will not be processed.
An error occurred for the request "http://www.publictalksoftware.co.uk/public_talks/HelpOnline/'%20+%20F%20+%20'". Error: 0, Status: 404, Reason: Not Found. This target will not be processed.
An error occurred for the request "http://www.publictalksoftware.co.uk/public_talks/HelpOnline/'+tabs[0]+'". Error: 0, Status: 404, Reason: Not Found. This target will not be processed.
Validating "http://www.publictalksoftware.co.uk/public_talks/HelpOnline/files/supply.js"...
Again, I am not sure about twhere the issue is exactly.

If you can clarify if there are errors that I need to bring to the attention of the chm2web author then I would appreciate it.

Thanks.

Andrew

ajtruckle
Rank II - Novice
Rank II - Novice
Posts: 47
Joined: Sat Feb 27, 2010 1:24 pm

Re: Clarification about some errors please

Post by ajtruckle » Tue Jul 06, 2010 7:35 am

It seems to me that the validator is getting a bit confused. For example:

Code: Select all

<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script type="text/JavaScript" src="files/treearr.js"></script>
<script type="text/JavaScript" src="files/supply.js"></script>
<script type="text/javascript">
 chmtop.c2wtopf = window; 
 var pageid=""; var searchquery=""; var indexquery=""; var syncmode=false; var pagenum=0;
 var qs = location.search.substr(1); var A  = qs.split("&");
 var B  = null; var F  = "source/helpsoundrota.htm"; var FT = "c";
 for(var i=0;i<A.length;i++){ B=A[i].split("="); A[i]=[B[0],B[1]]; }
 for (var j=0;j<A.length;j++){ 
   if(A[j][0]=="page") F=A[j][1]; 
   if(A[j][0]=="tab") FT=A[j][1];
  }
 F = unescape(F); 
</script>

<script type="text/JavaScript">
var tabs = new Array(2);
switch (FT) {
 case "i": tabs[0]="helpheaderi.html";tabs[1]="helpindex.html"; break; 
 case "s": tabs[0]="helpheaders.html";tabs[1]="helpsearch.html"; break; 
 default: tabs[0]="helpheaderc.html";tabs[1]="helpcontents.html"; break; 
} </script>

<title>SoundRota Online Help</title></head><script type="text/JavaScript">
document.write('<frameset rows="30,*" frameborder="yes" framespacing="2" border="0" bordercolor="#85A4C2">');
document.write('<frame name="header" src="'+tabs[0]+'" scrolling="no">');
document.write('<frameset cols="250,*" frameborder="yes" border="4">');
document.write('<frame name="toc" src="'+tabs[1]+'">');
document.write('<frame name="content" src="' + F + '" >');
document.write('</frameset>');
document.write('</frameset>');
</script>

<noscript><body><p>To display this page you need a browser with JavaScript support.</p><a href="helpcontents.html">Help contents</a></body></noscript></html>
Take the code:

<title>SoundRota Online Help</title></head><script type="text/JavaScript">
document.write('<frameset rows="30,*" frameborder="yes" framespacing="2" border="0" bordercolor="#85A4C2">');

The javascript is writing out the "<frameset ..."> code into the page. So surely the context is correct? :?

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3451
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Clarification about some errors please

Post by Albert Wiersch » Tue Jul 06, 2010 3:06 pm

ajtruckle wrote:Here are the errors from the report:

Code: Select all

http://www.publictalksoftware.co.uk/public_talks/HelpOnline/
Line:char	Type	Message Description
24:48	Error	The "script" element cannot be used here. It is not contained in an element that allows its use.

<title>Public Talks Online Help</title></head><script type="text/JavaScript">
I would recommend moving the "script" element into the "head" or "body" section. CSE HTML Validator doesn't like it if it's not in one of those elements. I would definitely bring that to the attention of the chm2web author - and see if the "script" element can be put in a proper place.

Also, using JavaScript to insert elements into documents is not recommended as there are lots of potential issues, but if the system you use does this, CSE HTML Validator may not be able to check it well as it does not interpret/run JavaScript, so it won't insert those elements into the document before it checks it.
ajtruckle wrote:Finally, I also got these errors:

Code: Select all

Requested "http://www.publictalksoftware.co.uk/public_talks/HelpOnline/helpcontents.html".
Initiated a total of 6 URL downloads.
Waiting for all (if any) HTTP downloads to finish...
An error occurred for the request "http://www.publictalksoftware.co.uk/public_talks/HelpOnline/'+tabs[1]+'". Error: 0, Status: 404, Reason: Not Found. This target will not be processed.
An error occurred for the request "http://www.publictalksoftware.co.uk/public_talks/HelpOnline/'%20+%20F%20+%20'". Error: 0, Status: 404, Reason: Not Found. This target will not be processed.
An error occurred for the request "http://www.publictalksoftware.co.uk/public_talks/HelpOnline/'+tabs[0]+'". Error: 0, Status: 404, Reason: Not Found. This target will not be processed.
Validating "http://www.publictalksoftware.co.uk/public_talks/HelpOnline/files/supply.js"...
Again, I am not sure about twhere the issue is exactly.

If you can clarify if there are errors that I need to bring to the attention of the chm2web author then I would appreciate it.
I'd have to see the source to know how CSE HTML Validator is picking up these links. It could be an error in the code not being processed by server as expected or a programming error generating bad HTML. Do you know what URL is linking to those 404 links? You may be able to tell by looking at the link reports.
Image
Albert Wiersch

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3451
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Clarification about some errors please

Post by Albert Wiersch » Tue Jul 06, 2010 3:11 pm

ajtruckle wrote:It seems to me that the validator is getting a bit confused.
Yes, CSE HTML Validator doesn't interpret JavaScript so it can get "confused" if JavaScript is inserting elements into the page.

I do see the badly placed "script" element in the code you quoted, however. Technically, according to the specs, it's not correct, though it may work in browsers that support that type of construct that uses JavaScript.
Image
Albert Wiersch

ajtruckle
Rank II - Novice
Rank II - Novice
Posts: 47
Joined: Sat Feb 27, 2010 1:24 pm

Re: Clarification about some errors please

Post by ajtruckle » Tue Jul 06, 2010 4:13 pm

Albert Wiersch wrote:I'd have to see the source to know how CSE HTML Validator is picking up these links. It could be an error in the code not being processed by server as expected or a programming error generating bad HTML. Do you know what URL is linking to those 404 links? You may be able to tell by looking at the link reports.
They are all generated due to JavaScript in the main index.html file:

Code: Select all

<script type="text/JavaScript">
document.write('<frameset rows="30,*" frameborder="yes" framespacing="2" border="0" bordercolor="#85A4C2">');
document.write('<frame name="header" src="'+tabs[0]+'" scrolling="no">');
document.write('<frameset cols="200,*" frameborder="yes" border="4">');
document.write('<frame name="toc" src="'+tabs[1]+'">');
document.write('<frame name="content" src="' + F + '" >');
document.write('</frameset>');
document.write('</frameset>');
</script>
I can see the three lines of JavaScript there.

Thoughts?

Andrew

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3451
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Clarification about some errors please

Post by Albert Wiersch » Tue Jul 06, 2010 4:32 pm

ajtruckle wrote:Thoughts?
Hi Andrew,

CSE HTML Validator may be getting confused and not parsing the document correctly due to the tags being inserted by JavaScript and bad location for the "script" element. You may want to try turning off (uncheck) the "Try to recover from mismatched or missing quotes" option in Options->Validator Engine Options->Miscellaneous page and see if that fixes the link issue.
Image
Albert Wiersch

ajtruckle
Rank II - Novice
Rank II - Novice
Posts: 47
Joined: Sat Feb 27, 2010 1:24 pm

Re: Clarification about some errors please

Post by ajtruckle » Tue Jul 06, 2010 4:37 pm

I will try. The thing is, the author tells me that framesets to do have to reside in a <body> tag. So since they are writing out the frameset code via java, the resulting html in the browser is valid (in their opinion). I will try the setting tomorrow.

Andrew

Post Reply