Good afternoon,

On 9/03/11 at 3:27 PM -0800, Watts Martin <[email protected]> wrote:

On Mar 7, 7:23 pm, Alex Satrapa <[email protected]> wrote:

Apart from a small set, HTML 5 deprecates named entities in favour of
Unicode numerical entities, expressed in decimal. That is, rather
than ‘&ldquo;’ or ‘&#x201c;’ use ‘&#8220;’.

I don’t follow the HTML5 community, so I’m not aware of any plans to
deprecate entities in favour of straight Unicode. I prefer using
Unicode characters, since that’s what I’m using in my day to day work.

I don't see anything in the HTML5 spec that says anything about this
deprecation, although it's admittedly a rather dense spec and I may
easily have missed it. Nonetheless, there's a table in the HTML5 spec
right now reading "Named character references": "this table lists the
character reference names supported by HTML and the code points to
which they refer." This at least suggests that you're still going to
be able to use named entities.

http://dev.w3.org/html5/spec/Overview.html#named-character-references

Yep, I saw that too, but one has to infer that named entities are OK. Doing a validation with the w3c tool I get errors (or maybe it was warnings) when using all but a few named entities; so one would infer from that they are deprecated.

And this page explicitly states all but a few (5 of them) are no longer valid:

<http://www.html-5.com/cheat-sheet/html-character-codes.html>

So until there is some clear documentation (that I can find), I'm going with the most clear documentation rather than docco that I have to make inferences from.

OK, I hadn't previously read the "8.1.4 Character references" section in the URL you gave above. That does seem to clearly indicate that the list of named references is allowed.

And I just tried validating pages again which contain named references, and I'm not getting any errors now. I don't know whether they have since fixed the validator, or maybe I was dealing with a compound error problem when I got the named entity errors (eg. maybe I had an <?xml?> stanza at the time).

Yep, that was it, when including an xml stanza then named entities (except 5 of them listed on page I gave above) are not allowed. Eg. I get the following error when using "&copy;":

    reference to undeclared general entity copy

There is a way to declare the named entities, but I found it easier to just use numeric entities, especially since the Entity palette in BBEdit lists all the numbers with the names.

The <?xml ...?> stanza is only *recommended* for html5, and is only needed if serving pages as application/xhtml (rather than text/html) so I chose to leave off the xml stanza.

<http://www.html-5.com/tags/xml-declaration/index.html>
<http://www.html-5.com/tags/doctype-declaration/index.html> this page shows how to declare named entities (although I couldn't get it to validate)

Bottom line, based on my testing (I'd still like to find some clear documentation), named entities are OK for html5 documents served as text/html (with no <?xml?> stanza) and named entities are NOT OK for documents served as application/xhtml (with <?xml?> stanza).

The following named entities are always OK since they are needed as part of the XML spec:

 &amp; &lt; &gt; &quot; &apos;


Charlie

--
   Ꮚ Charlie Garrison ♊ <[email protected]>

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

--
You received this message because you are subscribed to the "BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to