Entity Name or Entity Number?

S

Samuel van Laere

Does it matter if one uses Entity Names or Entity Numbers?
Both seems to work fine either way, but perhaps i'm mistaking.

Cheers,
Sam
 
?

=?ISO-8859-1?Q?G=E9rard_Talbot?=

Samuel van Laere wrote :
Does it matter if one uses Entity Names or Entity Numbers?
Both seems to work fine either way, but perhaps i'm mistaking.

Cheers,
Sam


For code maintainability, I recommend names over numbers. Names are more
meaningful, self-explanatory, intuitive than numbers.

Gérard
 
J

Jukka K. Korpela

Scripsit Samuel van Laere:
Does it matter if one uses Entity Names or Entity Numbers?
Both seems to work fine either way, but perhaps i'm mistaking.

There are no entity numbers, though even the W3C uses sloppy (wrong) terms.
The question is whether you should use entity references (for predefined
entities) or character references. See
http://www.cs.tut.fi/~jkorpela/chars/ref.html

The short answer is that for ISO Latin 1 characters it does not matter, and
for other characters there is a little wider support to character
references.

What matters is that you should use the trailing semicolon ";", even though
SGML rules don't always require it. IE 7 incorrectly fails to recognize e.g.
&Omega without the semicolon.
 
S

Samuel van Laere

Jukka K. Korpela said:
There are no entity numbers, though even the W3C uses sloppy (wrong)
terms. The question is whether you should use entity references (for
predefined entities) or character references. See
http://www.cs.tut.fi/~jkorpela/chars/ref.html

Just to be sure, what should one use when using UTF8?
I'm not sure if it has anything to do with the subject. I'll ask here :)
I've used character references, and hopefully I did the right thing.
For me, its a complicated subject anyhow :|
Not easy to grasp at all.
Boy there's a lot more to HTML then just <Hx> and <p>

Cheers to all,
Sam
 
J

Jukka K. Korpela

Scripsit Samuel van Laere:
Just to be sure, what should one use when using UTF8?
I'm not sure if it has anything to do with the subject.

It has quite a lot to do with it, since using UTF-8, you can insert _any_
character as such into the document and won't need entity or character
references. You might still _want_ to use either of them, e.g. if you don't
know how to enter an arbitrary character (there's virtually always some way
when you use a UTF-8 enabled editor) or if the character is not a normal
graphic character but e.g. the no-break space, the zero width joiner or the
soft hyphen.
I've used character references, and hopefully I did the right
thing.

No problem. No need to change them. Using UTF-8, you could save some bytes
by entering the characters directly, but it probably does not pay off to
change existing document in this respect.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top