Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Character reference or entity references?

Reply
Thread Tools

Character reference or entity references?

 
 
C Davis
Guest
Posts: n/a
 
      02-03-2009
Hi. When I insert (say) a dash in Dreamweaver, it uses the character
reference – rather than the entity reference – . Is there a
good reason to use the character reference form rather than the more
readable entity reference?
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      02-03-2009
C Davis wrote:

> Hi. When I insert (say) a dash in Dreamweaver, it uses the character
> reference – rather than the entity reference – . Is there
> a good reason to use the character reference form rather than the more
> readable entity reference?


Not really, except that the entity reference needs an entity definition.
When playing with HTML, browsers are assumed to imply the definitions as per
HTML specifications. But when the data is processed by general XML tools,
such definitions might not be present.

Regarding readability, the en dash character itself is more readable than
any of the alternatives. Of course, the character encoding needs to be
correctly specified, and page editing needs to be done using software that
can handle the encoding that would be used (normally UTF-.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
 
 
 
Andy Dingley
Guest
Posts: n/a
 
      02-03-2009
On 3 Feb, 14:35, C Davis <(E-Mail Removed)> wrote:
> Hi. When I insert (say) a dash in Dreamweaver, it uses the character
> reference – rather than the entity reference &ndash; . Is there a
> good reason to use the character reference form rather than the more
> readable entity reference?


Use the character entity references rather than the numerics, as
they're more readable. Do this _provided_that_ there are suitable
character entity references for all of the characters you need to use.

If you're forced into using numerics, then that's probably time to
make sure your editing / publishing / serving process is UTF-8 clean
and then switch entirely to that. It's far easier to edit foreign
language content this way than dealing with codes.

It's still a good idea to use the "XML set" of character entity
references (&amp;, &lt; etc., but not &apos; for HTML) as it provides
a little protection against idiot parsers, even though this isn't a
character encoding issue so much as a syntactic one.

 
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
Entity Name or Entity Number? Samuel van Laere HTML 4 02-24-2007 10:11 PM
Character reference "&#c" is an invalid XML character cgbusch XML 6 09-02-2003 07:04 PM



Advertisments