Mobile app version of vmapp.org
Login or Join
Kaufman445

: Fixing validator error "cannot generate system identifier for general entity" The W3C validator shows a "cannot generate system identifier for general entity" error when attempting to validate a

@Kaufman445

Posted in: #Html #Javascript #Validation

The W3C validator shows a "cannot generate system identifier for general entity" error when attempting to validate a page that contains the following code:

<script type="text/javascript" src="http://view.light-speed.com/teamspeak3.php?IP=85.236.100.27&PORT=27617&QUERY=20274&UID=506987&display=none&font=12px&background=transparent&server_info_background=transparent&server_info_text=%23640d04&server_name_background=transparent&server_name_text=%23640d04&info_background=transparent&channel_background=transparent&channel_text=%23640d04&username_background=transparent&username_text=%23640d04"></script>


How do I get the validator to ignore this code when testing for errors?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Kaufman445

1 Comments

Sorted by latest first Latest Oldest Best

 

@Bryan171

The W3C's validator tool offers cryptic error messages, but it actually gives you the answer to solve this. It complains about the line you've highlighted with the message:


"The most common cause of this error is unencoded ampersands in URLs"


This means you need to encode the ampersands in any scripts you include by using &amp; instead of &. So instead of this:

<script type="text/javascript" src="http://view.light-speed.com/teamspeak3.php?IP=85.236.100.27&PORT=27617&QUERY=20274&UID=506987&display=none&font=12px&background=transparent&server_info_background=transparent&server_info_text=%23640d04&server_name_background=transparent&server_name_text=%23640d04&info_background=transparent&channel_background=transparent&channel_text=%23640d04&username_background=transparent&username_text=%23640d04"></script>


You need to use this (scroll to the right to see that the & have been replaced with&amp;):

<script type="text/javascript" src="http://view.light-speed.com/teamspeak3.php?IP=85.236.100.27&amp;PORT=27617&amp;QUERY=20274&amp;UID=506987&amp;display=none&amp;font=12px&amp;background=transparent&amp;server_info_background=transparent&amp;server_info_text=%23640d04&amp;server_name_background=transparent&amp;server_name_text=%23640d04&amp;info_background=transparent&amp;channel_background=transparent&amp;channel_text=%23640d04&amp;username_background=transparent&amp;username_text=%23640d04"></script>


Replacing that line will solve many of your errors. You can read more about the reason this is necessary in the common errors page that W3 links to from their validator.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme