Entity Name or Entity Number?

Discussion in 'HTML' started by Samuel van Laere, Feb 24, 2007.

  1. 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
    Samuel van Laere, Feb 24, 2007
    #1
    1. Advertising

  2. 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/Using_Web_Standards_in_your_Web_Pages
    =?ISO-8859-1?Q?G=E9rard_Talbot?=, Feb 24, 2007
    #2
    1. Advertising

  3. 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/
    Jukka K. Korpela, Feb 24, 2007
    #3
  4. "Jukka K. Korpela" <> schreef in bericht
    news:5f2Eh.2123$...
    >
    > 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
    Samuel van Laere, Feb 24, 2007
    #4
  5. 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/
    Jukka K. Korpela, Feb 24, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mayur
    Replies:
    2
    Views:
    1,014
    Natty Gur
    Jul 2, 2004
  2. markla
    Replies:
    1
    Views:
    543
    Steven Cheng
    Oct 6, 2008
  3. Norm
    Replies:
    3
    Views:
    2,709
  4. ThatsIT.net.au

    Entity, problem with entity key

    ThatsIT.net.au, Sep 6, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    1,195
    ThatsIT.net.au
    Sep 7, 2009
  5. mayur
    Replies:
    2
    Views:
    310
    Armando Hernandez
    Jul 16, 2004
Loading...

Share This Page