I spent part of this exciting Father’s Day Eve studying the Atom specification for a project I’m working on. The following questions arose. I make some conjectures below but I’m hoping some knowledgable folks can chime in.
First, may content marked with mode=”escaped” be entity encoded?
So far the examples I’ve seen that use mode=”escaped”, such as Movable Type’s default template, put their content in a CDATA. In section 3.1.2 the Atom specification states that
|A mode attribute with the value “escaped” indicates that the element’s content is an escaped string.|
but does not provide a definition or pointer for the term “escaped string”. Assuming the same usage as the XML specification, I believe that entity encoding is allowed so long as non-default entities are property declared (the defaults are: amp, lt, gt, apos, quot). Is this correct?
Second, should mode=”escaped” be interpreted as redundant information when combined with CDATA?
If I read the XML spec correctly, CDStart indicates unambiguously how to treat the text that follows. If mode=”escaped” is redundant, then consuming code should take the text inside the CDATA section and run with it. However, if mode=”escaped” is not redundant, consuming code should take the text inside the CDATA section and unescape it. But the latter approach seems too complicated so I’m pretty sure mode=”escaped” is redundant when CDATA is used. Is this correct?
Any answers, pointers or clarifications would be greatly appreciated.