Subject: atom:name ... text or html?

From: Eric Scheid <[email-masked]>
Date: Fri, 24 Mar 2006 03:16:18 +1100

If I have an author with the name "Bertrand Café", is it acceptable to put
that into atom:author like this;

    <author><name><![CDATA[Bertrand Caf&eacute;]]></name></author>

or should I be using the unicode numeric entity instead?

e.

---

From: Anne van Kesteren <[email-masked]>
Date: Thu, 23 Mar 2006 17:21:38 +0100

> or should I be using the unicode numeric entity instead?

Even if it was "HTML" you couldn't really use the entity, could you? I 
think you
have to use a character reference or the actual character instead, yes.

-- 
Anne van Kesteren
<http://annevankesteren.nl/>

---

From: James M Snell <[email-masked]>
Date: Thu, 23 Mar 2006 08:36:45 -0800

+1 to what Anne says.  If I received that Atom author name, I would
display it exactly as presented "Bertrand Caf&eacute;"

- James

---

From: "James Holderness" <[email-masked]>
Date: Thu, 23 Mar 2006 18:48:36 +0200

Hahaha! It's RSS all over again. In the words of Mark Pilgrim: "Here's 
something that might be HTML. Or maybe not. I can't tell you, and you can't 
guess." :-)

Seriously though, the atom:name element is described as "a human-readable 
name", so unless your name really is "Betrand Caf&eacture;" that can't be 
right. If RFC4287 had intended to allow markup in the element it would have 
used atomTextConstruct.

Regards
James

---

From: Eric Scheid <[email-masked]>
Date: Fri, 24 Mar 2006 03:57:11 +1100

On 24/3/06 3:21 AM, "Anne van Kesteren" <[email-masked]> wrote:

> Even if it was "HTML" you couldn't really use the entity, could you? I think
> you have to use a character reference or the actual character instead, yes.
> 

It's true that XML has only a half dozen or so entities defined, meaning
most interesting entities from html can't exist in XML ... unless maybe they
are wrapped like in CDATA block like above?

I'm getting the data by scraping an html page, so I'm expecting it to be
acceptable html code, including html entities.

e.

---

From: "A. Pagaltzis" <[email-masked]>
Date: Thu, 23 Mar 2006 18:01:12 +0100

* Eric Scheid <[email-masked]> [2006-03-23 17:30]:
>If I have an author with the name "Bertrand Café", is it
>acceptable to put that into atom:author like this;
>

No. That means the author’s name is Bertrand Caf&eacute; (he must
have had very cruel parents), not Bertrand Café.

>or should I be using the unicode numeric entity instead?

Yes. Or use a literal é as you did in this mail, provided you
emit the feed as UTF-8 (or ISO-8859-1, if you must).

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

---

From: Sylvain Hellegouarch <[email-masked]>
Date: Thu, 23 Mar 2006 17:01:03 +0100

>
> Seriously though, the atom:name element is described as "a 
> human-readable name", 
Do you mean that "human-readable" is equivalent to solely English? 
Because as a French, having accents in names is so natural that I see it 
as "human readable" too ;)

- Sylvain

---

From: Stephane Bortzmeyer <[email-masked]>
Date: Thu, 23 Mar 2006 18:03:23 +0100

On Fri, Mar 24, 2006 at 03:16:18AM +1100,
 Eric Scheid <[email-masked]> wrote 

> or should I be using the unicode numeric entity instead?

Or the character itself, in UTF-8 or any other encoding (but UTF-8 is
the most widely implemented, so you limit the risks).

(That's what I do with http://www.bortzmeyer.org/feed.atom and it
seems OK in every agregator and it validates.)

---

From: "James Holderness" <[email-masked]>
Date: Thu, 23 Mar 2006 19:11:21 +0200

Sylvain Hellegouarch wrote:
> Do you mean that "human-readable" is equivalent to solely English? Because 
> as a French, having accents in names is so natural that I see it as "human 
> readable" too ;)

No. I mean that the literal sequence of characters "& e a c u t e ;" is not 
human-readable (or at least isn't intended to be).

Regards
James

---

From: David Powell <[email-masked]>
Date: Thu, 23 Mar 2006 17:23:21 +0000

> are wrapped like in CDATA block like above?

atom:name is not intended to contain HTML, the spec for it doesn't
mention HTML, it is no more correct to put HTML in it, than it is to
put base64'd PDF in there.

> acceptable html code, including html entities.

Your HTML parser should decode the entities for you and return a
string. Your Atom generator should encode or escape the string using
numeric entities.

If you really need to use HTML entities directly, then you could put:

<!DOCTYPE feed [
<!ENTITY eacute "&#233;">
]>

at the top of your feed and get rid of that CDATA. XML processors are
REQUIRED [1] to process internal DTD subsets.

[Hmm, internal DTD subsets completely fail in IE7's feed reader,
throwing up a "friendly error message"]

[1] <http://www.w3.org/TR/2004/REC-xml-20040204/#proc-types>

-- 
Dave

---

From: Stephane Bortzmeyer <[email-masked]>
Date: Thu, 23 Mar 2006 18:28:50 +0100

On Thu, Mar 23, 2006 at 05:01:03PM +0100,
 Sylvain Hellegouarch <[email-masked]> wrote 
 a message of 11 lines which said:

> Because as a French, having accents in names is so natural that I
> see it as "human readable" too ;)

As I wrote and used and tested on my blog, there is no problem in Atom
to have a first name with accent like mine. Atom is XML and therefore
Unicode rules.

---

From: "A. Pagaltzis" <[email-masked]>
Date: Thu, 23 Mar 2006 18:42:05 +0100

* Eric Scheid <[email-masked]> [2006-03-23 18:05]:
>It's true that XML has only a half dozen or so entities defined,
>meaning most interesting entities from html can't exist in XML
>... unless maybe they are wrapped like in CDATA block like
>above?

No, a CDATA block simply means that characters like <, & and >
stand for themselves.

>I'm getting the data by scraping an html page, so I'm expecting
>it to be acceptable html code, including html entities.

Then decode the entities to a Unicode string and emit the feed as
Unicode. Simplest thing that will work reliably.

Regards,

---

From: "A. Pagaltzis" <[email-masked]>
Date: Thu, 23 Mar 2006 18:39:35 +0100

* Sylvain Hellegouarch <[email-masked]> [2006-03-23 18:15]:
>Do you mean that "human-readable" is equivalent to solely
>English? Because as a French, having accents in names is so
>natural that I see it as "human readable" too ;)

Even as a French, you probably write é, not &eacute;. :-)

Regards,

---

From: "James Holderness" <[email-masked]>
Date: Thu, 23 Mar 2006 19:57:35 +0200

> throwing up a "friendly error message"]

If I remember correctly they considered that a feature. Something to do with 
DTDs being a security risk. I'm not sure if this also meant they were 
incapable of processing Netscape RSS 0.91 feeds. All I know is that if I 
ever have a blog, I'll be sure to include a DTD at the top of my feed.

Regards
James

---

From: Tim Bray <[email-masked]>
Date: Thu, 23 Mar 2006 10:14:12 -0800

On Mar 23, 2006, at 8:01 AM, Sylvain Hellegouarch wrote:

>
>
>>
>> Seriously though, the atom:name element is described as "a human- 
>> readable name",

You can have accents, you just can't use HTML entities to get them. -Tim

---

From: Tim Bray <[email-masked]>
Date: Thu, 23 Mar 2006 10:13:23 -0800

On Mar 23, 2006, at 8:57 AM, Eric Scheid wrote:

> It's true that XML has only a half dozen or so entities defined

To be precise, 5: &lt; &amp; &gt; &apos; &quot; -Tim

---

From: Tim Bray <[email-masked]>
Date: Thu, 23 Mar 2006 10:16:30 -0800

> or should I be using the unicode numeric entity instead?

The key point is that the atom:name element, described in RFC4287  
3.2.1, is not a "Text Construct", as defined in 3.1, so you can't say  
<atom:name type="html">; so no markup allowed.  So just say "Bertrand  
Café".  -Tim

---

From: Eric Scheid <[email-masked]>
Date: Fri, 24 Mar 2006 09:20:24 +1100

> Unicode. Simplest thing that will work reliably.

I figured as much. Oh well, now to track down a list of html entities and
their corresponding unicodes ...

e.

---

From: Tim Bray <[email-masked]>
Date: Thu, 23 Mar 2006 14:46:49 -0800

On Mar 23, 2006, at 2:20 PM, Eric Scheid wrote:

> Oh well, now to track down a list of html entities and

http://www.google.com/search?q=xhtml%20entities

---

From: "A. Pagaltzis" <[email-masked]>
Date: Thu, 23 Mar 2006 23:47:51 +0100

* Eric Scheid <[email-masked]> [2006-03-23 23:30]:
>Oh well, now to track down a list of html entities and their
>corresponding unicodes ...

That would be in the spec.
http://www.w3.org/TR/REC-html40/sgml/entities.html

But you shouldn’t have to. Any self-respecting language has a
library for that somewhere.

Regards,