Convert ampersands in URLs?
-
Hi!
I noticed today that my blog isn’t validating as XHTML 1.0 Transitional, and it seems to be a problem with the ampersands (&) in a couple of URLs I have posted.
This is the error reported by the validator:
“Line 139, column 134: cannot generate system identifier for general entity “tag”
…ge/2100-1032_3-5245523.html?part=rss&tag=5245523&subj=news.1032.5″ rel=”exter
An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (;). The most common cause of this error is unencoded ampersands in URLs as described by the WDG in “Ampersands in URLs”.
Entity references start with an ampersand (&) and end with a semicolon (;). If you want to use a literal ampersand in your document you must encode it as “&” (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and æ are different characters.
Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.”
The way to solve this is change the & in the URL to & … Is there a way to get WordPress to do this automatically?
Thanks!
The topic ‘Convert ampersands in URLs?’ is closed to new replies.