In A "schema" link for Atom I proposed a new type of link relation for Atom entry and feed documents. I want to add content (foreign markup, in Atom terms) to an Atom entry, and I want to associate a schema with that content. If you don't think this is useful, then you don't need the schema link.
I think most entries in a given feed will use the same schema, and therefore it is a useful optimization to be able to assign a default schema in a feed document. Another benefit of doing this is that content creators can verify their document structure before posting it to the server. Therefore, an Atom schema link can appear in a feed document or in an atom:entry; the entry-level overrides the feed-level schema. (A server is free to reject an entry with a conflicting schema, of course.)
Here is what one looks like:
<link xmlns:fema="http://www.ibm.com/xmlns/stdwip/...." rel="schema" for="fema:data" type="application/xsd+xml" href="http://schemas.example.com/xsd-files/my-schema.xsd"/>
I think different parts of the feed could come from different components of a system, and each have its own schema. The
for attribute specifies which part of the entry the schema applies to. It's a qname. Yeah, ugh, but I couldn't think of a better syntax.
There are multiple schema languages; not everyone uses XSD. The Atom and AtomPub RFC's use RelaxNG, for example. The DMTF has its own schema language. If I wanted to replace SNMP with a feed, I might want to use ASN.1 (presumably with the XER) to describe that data. DataPower has its own schema language for configuration (and events, and status, and actions...). And so on. It appears the right way to do this is to use the MIME content-type to define the schema language. This is the purpose of the
type attribute -- it specifies the schema language being used.
I made up the
xsd+xml MIME type. XSD just uses "application/xml" and I need to convince some people of the utility of my suggestion. :)
As you expect, the
href attribute specifies the URL where the schema can be found.
If you only want to use XSD, and you don't want to set feed-level defaults, then you don't need the schema link. Just use xsi:schemaLocation on the appropriate feed entries.