Craig Lambie
asked on
"Entity 'reg' not defined error" ® XHTML Mobile 1.2
Hi experts,
I am getting a validation error for "®" HTML entity when I use this DocType below.
Any ideas on how to avoid this from appearing?
DocType
I am getting a validation error for "®" HTML entity when I use this DocType below.
Any ideas on how to avoid this from appearing?
DocType
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
Validation Error Appearing on this line<a href="http://www.s2member.com/" onclick="window.open('http://www.s2member.com/s-badges/s-details.php?v=1&site_url=http%3A%2F%2Fm.truesecrets.com.au%2Fstrange-tours-melbourne', '_popup', 'width=752,height=702,left='+((screen.width/2)-(752/2))+',screenX='+((screen.width/2)-(752/2))+',top='+((screen.height/2)-(702/2))+',screenY='+((screen.height/2)-(702/2))+',location=0,menubar=0,toolbar=0,scrollbars=0,resizable=1'); return false;" title="s2Member®"><img src="//www.s2member.com/s-badges/s-badge.php?v=1&site_url=http%3A%2F%2Fm.truesecrets.com.au%2Fstrange-tours-melbourne" style="border:0;" alt="s2Member®" title="s2Member® ( Security for WordPress® )" /></a>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It is not a w3c standard it is a IETF standard.
The relevant standard is RFC1738 (IETF) which specifies that an ampersand in a url should be encoded as %26.
There is a list of the url encoded values HERE
Cd&
The relevant standard is RFC1738 (IETF) which specifies that an ampersand in a url should be encoded as %26.
There is a list of the url encoded values HERE
Cd&
ok, we need to be pedantic:
the reference is http://www.rfc-editor.org/rfc/rfc1866.txt
see 3.2.4. Attributes
Not sure if there is a newer RFC which defines this different.
HTML Entities in the attribute value must be written as NCR (numeric character reference),
exceptions are only the SGML NCE (named character entity) & < > and (depending
on the implementation of the tool) "
It's all about HTML here according the example in the question), not URL or URI, or URL/URI inside HTML tag attributes (which are a different cumbersome story).
the reference is http://www.rfc-editor.org/rfc/rfc1866.txt
see 3.2.4. Attributes
Not sure if there is a newer RFC which defines this different.
HTML Entities in the attribute value must be written as NCR (numeric character reference),
exceptions are only the SGML NCE (named character entity) & < > and (depending
on the implementation of the tool) "
It's all about HTML here according the example in the question), not URL or URI, or URL/URI inside HTML tag attributes (which are a different cumbersome story).
You are correct in saying that this is a tagging issue not a url issue I think I read it wrong. I saw the ampersand being used as separator and thought that was the issue.
In 8.2.1 of RFC1866 there is a note:
" NOTE - The URI from a query form submission can be
used in a normal anchor style hyperlink.
Unfortunately, the use of the `&' character to
separate form fields interacts with its use in SGML
attribute values as an entity reference delimiter.
For example, the URI `http://host/?x=1&y=2' must be
written `<a href="http://host/?x=1&y=2"' or `<a
href="http://host/?x=1&y=2">'.
HTTP server implementors, and in particular, CGI
implementors are encouraged to support the use of
`;' in place of `&' to save users the trouble of
escaping `&' characters this way."
I was working on another question where there is an issue with apersand as part of the url and I read this one too quickly and thought it was the same issue. I apologize for sidetracking the question.
Cd&
In 8.2.1 of RFC1866 there is a note:
" NOTE - The URI from a query form submission can be
used in a normal anchor style hyperlink.
Unfortunately, the use of the `&' character to
separate form fields interacts with its use in SGML
attribute values as an entity reference delimiter.
For example, the URI `http://host/?x=1&y=2' must be
written `<a href="http://host/?x=1&y=2"' or `<a
href="http://host/?x=1&y=2">'.
HTTP server implementors, and in particular, CGI
implementors are encouraged to support the use of
`;' in place of `&' to save users the trouble of
escaping `&' characters this way."
I was working on another question where there is an issue with apersand as part of the url and I read this one too quickly and thought it was the same issue. I apologize for sidetracking the question.
Cd&
> .. , CGI
implementors are encouraged to support the use of
`;' in place of `&' to save users the trouble of
nice catch!
How many modern web/application servers still comply to that RFC (my guess: none).
I only know from ancient Netscape which did it that way too.
And perl's CGI.pm is still RFC compliant ;-)
Anyway, this is about URL/URI which is not the case in the question.
implementors are encouraged to support the use of
`;' in place of `&' to save users the trouble of
nice catch!
How many modern web/application servers still comply to that RFC (my guess: none).
I only know from ancient Netscape which did it that way too.
And perl's CGI.pm is still RFC compliant ;-)
Anyway, this is about URL/URI which is not the case in the question.
I always use ; because & requires shift and stretch up to the top row of the keyboard and I am a lazy typist. ;^)
So I reserve & for entities and signatures.
Cd&
So I reserve & for entities and signatures.
Cd&
ASKER
Ok, so I am a little lost now.
The issue I have is with validation for "®" the only other option I can see is to use "®"
This is some sort of limitation with the DTD, not really anything to do with RFC 1866, URI/ URL.
I simply want the mobile browsers to correctly render the HTML on this page
http://m.truesecrets.com.au/strange-tours-melbourne/ (the page with the "@reg;" on it isn't public sorry, but similar DTD related validation errors on this page)
The issue I have is with validation for "®" the only other option I can see is to use "®"
This is some sort of limitation with the DTD, not really anything to do with RFC 1866, URI/ URL.
I simply want the mobile browsers to correctly render the HTML on this page
http://m.truesecrets.com.au/strange-tours-melbourne/ (the page with the "@reg;" on it isn't public sorry, but similar DTD related validation errors on this page)
so you also get validation errors for ® or ®
ASKER
the application that is putting the "®" entity in place I don't have control over, so for now I have disabled it.
I am not sure what you mean by "®" ??
I am not sure what you mean by "®" ??
ASKER
the application that is putting the "®" entity in place I don't have control over, so for now I have disabled it.
I am not sure what you mean by "®" ??
I am not sure what you mean by "®" ??
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I managed to find the function and change it to the #160; version and it validated :)
ASKER