{"id":55,"date":"2008-08-07T20:30:49","date_gmt":"2008-08-08T04:30:49","guid":{"rendered":"http:\/\/www.corneliadavis.com\/blog\/?p=55"},"modified":"2008-08-07T20:30:49","modified_gmt":"2008-08-08T04:30:49","slug":"xsd-for-atom","status":"publish","type":"post","link":"https:\/\/corneliadavis.com\/blog\/2008\/08\/07\/xsd-for-atom\/","title":{"rendered":"XSD for Atom"},"content":{"rendered":"<p>Another question I&#8217;ve fielded several times over the last weeks: Is there any XSD for Atom?My first response: &#8220;What are you using the schema for?&#8221;  I won&#8217;t go into all of the details of that dialog, but remember that you should always carefully consider the use of a schema before building one.So to the point&#8230;<a href=\"http:\/\/www.ietf.org\/rfc\/rfc4287\">The Atom format spec<\/a> provides a Relax-NG schema, to provide a normative description of the atom syntax.  It is, however, not enough to validate XML against this schema as Relax-NG is not expressive enough to capture some of the other validity requirements for atom feeds or entries &#8211; namely the requirements listed in sections 4.1.1 and 4.1.2, respectively.  XML Schema is also not expressive enough, in fact, I don&#8217;t believe any schema language is and that is why we have the <a href=\"http:\/\/feedvalidator.org\/\">feed validator<\/a> (also available <a href=\"http:\/\/validator.w3.org\/feed\/\">here<\/a> &#8211; it&#8217;s opensource).  That being said, a schema can be used for more than validation, and quite a lot of tooling (e.g. web services tooling) leverages XSD.  Hence the question.I did a bit of digging and found what I think is the most recent (June) <a href=\"http:\/\/www.mail-archive.com\/abdera-user@incubator.apache.org\/msg00724.html\">Atom xsd thread<\/a> from the mailing lists.  In particular this thread showed up in the <a href=\"http:\/\/incubator.apache.org\/abdera\/\">Abdera<\/a> user mailing list &#8211; Abdera is an opensource implementation of both <a href=\"http:\/\/www.ietf.org\/rfc\/rfc4287.txt\">RFC 4287<\/a> and <a href=\"http:\/\/www.ietf.org\/rfc\/rfc5023.txt\">RFC 5023<\/a> as well as several extensions, both approved and internet drafts.  It is currently in incubation with Apache.In this particular thread <a href=\"http:\/\/dannyayers.com\/\">Danny Ayers<\/a> suggested <a href=\"http:\/\/www.thaiopensource.com\/relaxng\/trang.html\">Trang<\/a> for conversion from the Relax-NG schema to xsd.  I gave it a shot and while I haven&#8217;t used the resulting xsd for anything I did find that another internal project here at EMC using Atom did the same and are using that xsd.There doesn&#8217;t seem to be a defacto standard way of obtaining an xsd for the Atom format &#8211; this mechanism seems as good as any.UPDATE:  Unfortunately I have since found that the schema produced by trang is not valid.  The primary problem seems to be that it is hard to produce an XSD that allows for extension that is still deterministic.  More on that shortly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Another question I&#8217;ve fielded several times over the last weeks: Is there any XSD for Atom?My first response: &#8220;What are you using the schema for?&#8221; I won&#8217;t go into all of the details of that dialog, but remember that you should always carefully consider the use of a schema before building one.So to the point&#8230;The [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-55","post","type-post","status-publish","format-standard","hentry","category-atom"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/posts\/55","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/comments?post=55"}],"version-history":[{"count":0,"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/posts\/55\/revisions"}],"wp:attachment":[{"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/media?parent=55"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/categories?post=55"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/tags?post=55"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}