Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Entity Name or Entity Number?

Reply
Thread Tools

Entity Name or Entity Number?

 
 
Samuel van Laere
Guest
Posts: n/a
 
      02-24-2007
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


 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?G=E9rard_Talbot?=
Guest
Posts: n/a
 
      02-24-2007
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
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      02-24-2007
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.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
Samuel van Laere
Guest
Posts: n/a
 
      02-24-2007
"Jukka K. Korpela" <(E-Mail Removed)> schreef in bericht
news:5f2Eh.2123$(E-Mail Removed) ...
>
> 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


 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      02-24-2007
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.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Entity, problem with entity key ThatsIT.net.au ASP .Net 1 09-07-2009 02:20 AM
Entity Framework - Reassigning child entity's parent Norm ASP .Net 3 07-06-2009 07:28 PM
How to relate a SQL based entity with an Object based entity in Entity Framework markla ASP .Net 1 10-06-2008 09:42 AM
print("my name is {name}, and {age}-year old {gender}", name, age, gender); =?iso-8859-1?B?bW9vcJk=?= Java 7 01-02-2006 04:39 PM
Re: Urgent! how to get object name, method name and attribute name based on the strings? ding feng C++ 2 06-25-2003 01:18 PM



Advertisments