Click to See Complete Forum and Search --> : Page Validation...


weee
11-10-2004, 07:10 PM
I'm using strict DTD:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

I added a link into my page:
http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?playlistId=3605130&selectedItemId=3605125

For some reason, I'm getting 6 different errors for this link.
Why's that?

Here's the messages:
cannot generate system identifier for general entity "selectedItemId"

general entity "selectedItemId" not defined and no default entity

reference to entity "selectedItemId" for which no system identifier could be generated

entity was defined here

reference to entity "selectedItemId" for which no system identifier could be generated

entity was defined here

How can I fix it?

Thanks!

Charles
11-10-2004, 07:42 PM
In HTML the value of the "href" attribute is CDATA...From the HTML 4.01 Specification:
CDATA is a sequence of characters from the document character set and may include character entities. User agents should interpret attribute values as follows:

* Replace character entities with characters,
* Ignore line feeds,
* Replace each carriage return or tab with a single space.
http://www.w3.org/TR/html401/types.html#type-cdataIn other words, you can't have ampersands in an URL, not without escaping them.

weee
11-10-2004, 07:46 PM
I'm not really sure what do I need to do?

Charles
11-10-2004, 07:49 PM
If it wasn't in an attribute value, if it was the content of a text node, How would you indicate an ampersand? Do the same in the URL.

weee
11-10-2004, 07:54 PM
& amp;

Charles
11-10-2004, 08:00 PM
Indeed. &amp; indicates the start of an entity so when a parser hits "&selectedItemId" it starts looking for an entity named "&selectedItemId;" - in the same way "&amp;nbsp;" sends a parser looking. Without the semi-colon the whole token is used. Any way, "&selectedItemId;" isn't found and the validator returns an error.

weee
11-11-2004, 12:19 AM
Thanks