Eric Scheid wrote:
Is this a valid atom entry?
<entry>
[...elided...]
<summary>a snippet of foo xml</summary>
<content type="application/foo+xml">
<foo:thing xmlns:foo="http://xmlns.com/foo/0.1/">
<foo:name>King George</foo:name>
</foo:Person>
</content>
</entry>
I'm not sure if I misunderstood your question, or the mismatched tags are a
typo, but that's not even valid XML let alone valid atom.
That is, is a partial xml document valid inside the atom:content element?
Assuming that foo:Person close tag was meant to be a foo:thing close tag,
then if you can extract the section from <foo:thing> to </foo:thing> into a
file and view it successfully in a foo file viewer then I'd say it's a valid
Atom entry (assuming also that the foo file viewer only opens strictly valid
foo documents).
What about xml formats whose specs state that there must be a certain root
element (similar to how atom documents must have either <feed> or <entry>
as
root elements)?
To be honest, I didn't know you could get XML formats that didn't have an
explicit root element. Nevertheless I think the same tests apply. Can the
embedded XML section open successfully in a foo file viewer?
A more concrete example would be the use of application/xhtml+xml content
starting with a div tag rather than an html tag.
<entry>
[...elided...]
<summary>a snippet of xhtml</summary>
<content type="application/xhtml+xml">
<xh:div xmlns:xh="http://www.w3.org/1999/xhtml">
<xh:p>Not strictly valid Atom content.</xh:p>
</xh:div>
</content>
</entry>
While I'd expect most Atom clients to process such an entry successfully
(assuming they're capable of handling XML at all) I don't think it's
strictly valid Atom since you couldn't save that section to a file and
expect it to open successfully in a validating XHTML file viewer.
Regards
James