Subject: Private extensions and relation to atom elements

From: James Aylett <[email-masked]>
Date: Mon, 11 Sep 2006 12:27:12 +0100

We've run across a situation where we want to annotate an atom:icon
with a title. Currently we're doing the following, as something that
Feed Validator is happy with, but doesn't feel right:

----------------------------------------------------------------------
  <atom:icon>uri:to/icon</atom:icon>
  <myns:icon-title xml:lang='en' xmlns:myns='...'>My icon
    title</myns:icon-title>
----------------------------------------------------------------------

It doesn't express the relationship directly. The way that would be
most natural in XML doesn't seem to be allowed (because we don't have
extension attributes):

----------------------------------------------------------------------
  <atom:icon myns:title='My icon title' ...>uri:to/icon</atom:icon>
----------------------------------------------------------------------

and all other ways I can think of involve extension elements in the
wrong place.

Anyone have another suggestion on how to approach this? Or would we be
better off adding our own <myns:icon/> which we can decorate with
titles, languages and whatever to our heart's content, even though
it's redundant to some extent?

James

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                  xapian.org
  [email-masked]                               uncertaintydivision.org

---

From: James M Snell <[email-masked]>
Date: Mon, 11 Sep 2006 07:27:27 -0700

Using extension attributes is a perfectly legitimate solution.  The one
drawback is that not all implementations will support 'em.

- James

---

From: James Aylett <[email-masked]>
Date: Mon, 11 Sep 2006 15:45:53 +0100

> drawback is that not all implementations will support 'em.

That's not a problem, to be honest - we have (amongst other things) a
Flash 'player' for the atom feeds involved, and some clients want a
title alongside the feed icon and/or logo.

Feed Validator gets upset with extension attributes - is it wrong?

James

---

From: James M Snell <[email-masked]>
Date: Mon, 11 Sep 2006 08:09:27 -0700

atom:icon is defined as:

   atomIcon = element atom:icon {
      atomCommonAttributes,
      (atomUri)
   }

atomCommonAttributes is defined as:

   atomCommonAttributes =
      attribute xml:base { atomUri }?,
      attribute xml:lang { atomLanguageTag }?,
      undefinedAttribute*

The Validator should be ignoring any extensions (including attributes)
it is not familiar with so yes, I would say that it's wrong if its
returning an error.  A warning would be appropriate tho given that not
all implementations will be capable of making use of extension attributes.

One additional point, be sure to clearly define whether or not your
title attribute value should be interpreted as plain text or escaped
markup (preferably the former).

- James

---

From: James Aylett <[email-masked]>
Date: Mon, 11 Sep 2006 16:18:00 +0100

>       attribute xml:lang { atomLanguageTag }?,

Hmm, I'd misunderstood what undefinedAttribute meant. Or, more likely,
missed it entirely. Thanks :)

> all implementations will be capable of making use of extension attributes.

Should the validator have different levels of warning? For instance,
it warns you if you have some iTunes extensions but not others; it
warns you if your RSS uses dates in a strange format that some readers
might not be able to parse; it should warn here. These are all
different: specific application may have problems; general
applications may have problems with a core feature; general
applications may ignore an extension.

(This isn't really the right forum for this, so apologies.)

> markup (preferably the former).

Well, it's a private extension, so in practice you're not going to
know if we define it or not :-)

But yeah, point taken and I'll make sure it gets added to our spec
internally.

James

---

From: Tim Bray <[email-masked]>
Date: Mon, 11 Sep 2006 08:36:02 -0700

> Feed Validator is happy with, but doesn't feel right:

let's assume myns: is declared.  Then why not

<icon myns:buddha-nature="high" myns:sizzle="low">icon-uri<icon>

  -Tim

---

From: Tim Bray <[email-masked]>
Date: Mon, 11 Sep 2006 08:36:48 -0700

> Feed Validator gets upset with extension attributes - is it wrong?

Be specific, please?  -Tim

---

From: James Aylett <[email-masked]>
Date: Mon, 11 Sep 2006 17:20:54 +0100

> <icon myns:buddha-nature="high" myns:sizzle="low">icon-uri<icon>

Apologies to all - this is what we tried first, but there must have
been a typo or something, because the feed validator started shouting
at us. I've just checked again, and all is well.

Cheers,
James