& and ' in XHTML 1.0

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hey all...

validator.w3.org complains about & and ´.. in my text.... what do i use
instead.. ??

Re: & and ' in XHTML 1.0

Gazing into my crystal ball I observed Thomas Sørensen <noem@fjernmig-

Quoted text here. Click to load it

Escape it - &amp;

Adrienne Boswell
Please respond to the group so others can share

Re: & and ' in XHTML 1.0

Adrienne wrote:
Quoted text here. Click to load it

And all the others are defined at:

If you feel that any of the above is incorrect,
inappropriate or offensive in any way,
please ignore it and accept my apologies.

Re: & and ' in XHTML 1.0

thanks.... guys :)

Re: & and ' in XHTML 1.0

Here is what te W3C has to say on the subject: "C.12. Using Ampersands
in Attribute Values (and Elsewhere)In both SGML and XML, the ampersand
character ("&") declares the beginning of an entity reference (e.g.,
&reg; for the registered trademark symbol "®"). Unfortunately, many
HTML user agents have silently ignored incorrect usage of the
ampersand character in HTML documents - treating ampersands that do
not look like entity references as literal ampersands. XML-based user
agents will not tolerate this incorrect usage, and any document that
uses an ampersand incorrectly will not be "valid", and consequently
will not conform to this specification. In order to ensure that
documents are compatible with historical HTML user agents and
XML-based user agents, ampersands used in a document that are to be
treated as literal characters must be expressed themselves as an
entity reference (e.g. "&amp;"). For example, when the href attribute
of the a element refers to a CGI script that takes parameters, it must
be expressed as http://my.site.dom/cgi-bin/myscript.pl?class=guest&amp ;name=user
rather than as http://my.site.dom/cgi-bin/myscript.pl?class=guest&name=user ."
The situation is a bit different in a JavaScript used in the xhtml
versions. An isolated less than < and logical and && are not allowed
in the script on the xhtml page because of conflicts with XML. Writing
these out as you do for &, etc. on the xhtml part of the page kills
the script. If you can not avoid isolateed < and && in a script on an
xhtml page, you are allowed to solve the problem by using an external
script.As another choice, the complete script within the script tags
can be surrounded by open and close CDATA tags. Unfortuately, most
browsers and servers do not properly understand CDATA, and the script
fails. However it is possible to surround both the opening and closing
CDATA tags with multi-line JS comment tabs of the type /* blah blah */
. Then the older browsers and servers are happy, and the W3C xhtml
validator is happy. The XML things such as the CDATA tags are seen
through multiline JS comment tags, just as html comment tags are seen
through when placed around a JS.

Re: & and ' in XHTML 1.0

noem@fjernmig-noem.dk says...
Quoted text here. Click to load it

&amp; and whatever the entity is for an apostrophe.

Hywel     I do not eat quiche
http://hyweljenkins.co.uk /

Re: & and ' in XHTML 1.0

Hywel Jenkins wrote:

Quoted text here. Click to load it

&apos; is the official entity, although not supported by Internet
Explorer, so use &#39; or &#x27;

Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

Re: & and ' in XHTML 1.0

Thomas Sørensen wrote:
Quoted text here. Click to load it

For the apostrophe, &#8217 is used by many sites.

Mozilla on my Linux box displays this as a box
instead of an apostrophe.  Does anyone know where
to tweak Mozilla to kill this irritant?

Cheers, m   at http://www.mbstevens.com /

Re: & and ' in XHTML 1.0

m wrote:

Quoted text here. Click to load it

Some of the recent Linux builds of Mozilla and Firebird have a bug that
makes apostrophes and some other characters show up as boxes, although
the characters are all there in the font being used.

The only solution I know of is to use a build that ha GTK2 and XFT
compiled in. Here's such a version of Firebird 0.7:


If you look around you might be able to find a Mozilla build with GTK2
and XFT as well.


Re: & and ' in XHTML 1.0

Bertilo Wennergren wrote:
Quoted text here. Click to load it
Quoted text here. Click to load it

Thanks, I knew it had to be something simple.

Cheers, m

Site Timeline