& and ' in XHTML 1.0

  • Thread starter =?ISO-8859-1?Q?Thomas_S=F8rensen?=
  • Start date
?

=?ISO-8859-1?Q?Thomas_S=F8rensen?=

Hey all...

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

Adrienne

Gazing into my crystal ball I observed Thomas Sørensen <noem@fjernmig-
noem.dk> writing in
Hey all...

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

Escape it - &amp;
 
H

Hywel Jenkins

Hey all...

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

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

m

Thomas said:
Hey all...

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

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?
 
C

cwdjr

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.
 
T

Toby A Inkster

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

&apos; is the official entity, although not supported by Internet
Explorer, so use ' or '
 
B

Bertilo Wennergren

m said:
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?

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:

<URL:http://ftp.mozilla.org/pub/mozilla....ozillaFirebird-0.7-i686-linux-gtk2+xft.tar.gz>

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

m

Bertilo said:
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:

<URL:http://ftp.mozilla.org/pub/mozilla....ozillaFirebird-0.7-i686-linux-gtk2+xft.tar.gz>


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

Thanks, I knew it had to be something simple.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,281
Latest member
Pedroaciny

Latest Threads

Top