Yes, I haven’t RTFM. Sue me. Now that I use the RSS Reader in Firebird, I’ve noticed at least three camps of feeds.

Camp One: The Description node for each feed item is pure XHTML.

<description>
     <p>
          This is a <strong>para</strong>.
     </p>
</description>

Camp Two: The Description node for each feed item is XHTML in a CDATA node.

<description>
     <![CDATA[
          <p>
               This is a <strong>para</strong>.
          </p>
     ]]>
</description>

Camp Three: The Description node for each feed item is completely HTML encoded:

<description>
     <p>
          This is a <strong>para</strong>.
     </p>
</description>

So, the question is thus: Which method is correct? Is the Description contents a payload to be delivered and not rendered as part of the feeds DOM, or simply part of the original XML feed document DOM?

The results across feed readers seems to be somewhat inconsistant. Some appear to play smart and sniff out the content. Some simply display the the HTML serialized into the DOM. Some display the HTML as is. What’s the consensus?



OK, so I’ll do a little RTFMing.

According to the Atom 0.3 Draft Spec, the atom:content element has a mode attribute:

“xml”:
A mode attribute with the value
“xml” indicates that the element’s content is inline
xml (for example, namespace-qualified XHTML).
“escaped”:
A mode attribute with the
value “escaped” indicates that the element’s content
is an escaped string. Processors MUST unescape the
element’s content before considering it as content of
the indicated media type.
“base64”:
A mode attribute with the
value “base64” indicates that the element’s content is
base64-encoded [RFC2045]. Processors
MUST decode the element’s content before considering
it as content of the the indicated media type.

So, is data within a <![CDATA[ ]]> block considered “escaped”? I would think so, but hey. Who knows. Nice to see the Atom spec took this problem into account.

Now, what about RSS/RDF? If I have to pick a reason to like Atom feeds more, that little touch would probably be it.

See more posts about: www | All Categories