Log in

View Full Version : W3C Error because of '&'



round
05-02-2012, 07:19 AM
Hello,
I used to link my site to YouTube by using below location

'http://www.youtube.com/v/V9btuDOVLVU?ersion=3&feature=player_detailpage'

Its properly working but while checking w3c validations i got below error

cannot generate system identifier for general entity "feature"

I can not use '&amp' instead of '&' because it affects my actual location.

can anyone help me to solve this issue?

djr33
05-02-2012, 05:13 PM
Every time you use & in your HTML code, it should be &

That avoids confusing with the & operator that starts entities like that, as in the term & itself. Or ", etc.


Then it will be displayed as & and function that way, even in the case of URLs, etc. This SHOULD work, and it won't change the location that the URL points to-- browsers know how to deal with it.

On the other hand, I've never actually seen this cause errors in a page. It isn't valid, but it's a minor problem. But it's also easy to fix.

traq
05-02-2012, 08:19 PM
I can not use '&amp' instead of '&' ...
clarification/elaboration: I don't know if the above is a typo or not but you should be using & , NOT &amp .

jscheuer1
05-03-2012, 04:16 PM
That's right. And further, if it appears as a src attribute for an iframe and/or embed tag and/or as the value attribute of a param tag named 'movie', and/or as the data attribute of an object tag, using & is fine and will not cause any problem. If it's part of a script, the script can be made external or have its code commented appropriately to the DOCTYPE being validated.

In all these cases it will (assuming it worked with just &) work fine and will validate.

If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.