Home >> FAQs/Tutorials >> RSS Tutorials >> Index

RSS Tutorials - The Atom Syndication Format - Part 4

By: M. Nottingham, Ed. & R. Sayre, Ed.

(Continued from previous topic...)

The Atom Syndication Format - Part 4


          & atomLink*
          & atomLogo?
          & atomRights?
          & atomSubtitle?
          & atomTitle
          & atomUpdated
          & extensionElement*),
         atomEntry*
      }

   # atom:entry

   atomEntry =
      [
         s:rule [
            context = "atom:entry"
            s:assert [
               test = "atom:link[@rel='alternate'] "
               ~ "or atom:link[not(@rel)] "
               ~ "or atom:content"
               "An atom:entry must have at least one atom:link element "
               ~ "with a rel attribute of 'alternate' "
               ~ "or an atom:content."
            ]
         ]
         s:rule [
            context = "atom:entry"
            s:assert [
               test = "atom:author or "
               ~ "../atom:author or atom:source/atom:author"
               "An atom:entry must have an atom:author "
               ~ "if its feed does not."
            ]
         ]
      ]
      element atom:entry {
         atomCommonAttributes,
         (atomAuthor*
          & atomCategory*
          & atomContent?
          & atomContributor*
          & atomId
          & atomLink*
          & atomPublished?
          & atomRights?
          & atomSource?
          & atomSummary?
          & atomTitle

[Page 37]

          & atomUpdated
          & extensionElement*)
      }

   # atom:content

   atomInlineTextContent =
      element atom:content {
         atomCommonAttributes,
         attribute type { "text" | "html" }?,
         (text)*
      }

   atomInlineXHTMLContent =
      element atom:content {
         atomCommonAttributes,
         attribute type { "xhtml" },
         xhtmlDiv
      }

   atomInlineOtherContent =
      element atom:content {
         atomCommonAttributes,
         attribute type { atomMediaType }?,
         (text|anyElement)*
      }

   atomOutOfLineContent =
      element atom:content {
         atomCommonAttributes,
         attribute type { atomMediaType }?,
         attribute src { atomUri },
         empty
      }

   atomContent = atomInlineTextContent
    | atomInlineXHTMLContent
    | atomInlineOtherContent
    | atomOutOfLineContent

   # atom:author

   atomAuthor = element atom:author { atomPersonConstruct }

   # atom:category

   atomCategory =
      element atom:category {

[Page 38]

         atomCommonAttributes,
         attribute term { text },
         attribute scheme { atomUri }?,
         attribute label { text }?,
         undefinedContent
      }

   # atom:contributor

   atomContributor = element atom:contributor { atomPersonConstruct }

   # atom:generator

   atomGenerator = element atom:generator {
      atomCommonAttributes,
      attribute uri { atomUri }?,
      attribute version { text }?,
      text
   }

   # atom:icon

   atomIcon = element atom:icon {
      atomCommonAttributes,
      (atomUri)
   }

   # atom:id

   atomId = element atom:id {
      atomCommonAttributes,
      (atomUri)
   }

   # atom:logo

   atomLogo = element atom:logo {
      atomCommonAttributes,
      (atomUri)
   }

   # atom:link

   atomLink =
      element atom:link {
         atomCommonAttributes,
         attribute href { atomUri },
         attribute rel { atomNCName | atomUri }?,

[Page 39]

         attribute type { atomMediaType }?,
         attribute hreflang { atomLanguageTag }?,
         attribute title { text }?,
         attribute length { text }?,
         undefinedContent
      }

   # atom:published

   atomPublished = element atom:published { atomDateConstruct }

   # atom:rights

   atomRights = element atom:rights { atomTextConstruct }

   # atom:source

   atomSource =
      element atom:source {
         atomCommonAttributes,
         (atomAuthor*
          & atomCategory*
          & atomContributor*
          & atomGenerator?
          & atomIcon?
          & atomId?
          & atomLink*
          & atomLogo?
          & atomRights?
          & atomSubtitle?
          & atomTitle?
          & atomUpdated?
          & extensionElement*)
      }

   # atom:subtitle

   atomSubtitle = element atom:subtitle { atomTextConstruct }

   # atom:summary

   atomSummary = element atom:summary { atomTextConstruct }

   # atom:title

   atomTitle = element atom:title { atomTextConstruct }

   # atom:updated

[Page 40]

   atomUpdated = element atom:updated { atomDateConstruct }

   # Low-level simple types

   atomNCName = xsd:string { minLength = "1" pattern = "[^:]*" }

   # Whatever a media type is, it contains at least one slash
   atomMediaType = xsd:string { pattern = ".+/.+" }

   # As defined in RFC 3066
   atomLanguageTag = xsd:string {
      pattern = "[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*"
   }

   # Unconstrained; it's not entirely clear how IRI fit into
   # xsd:anyURI so let's not try to constrain it here
   atomUri = text

   # Whatever an email address is, it contains at least one @
   atomEmailAddress = xsd:string { pattern = ".+@.+" }

   # Simple Extension

   simpleExtensionElement =
      element * - atom:* {
         text
      }

   # Structured Extension

   structuredExtensionElement =
      element * - atom:* {
         (attribute * { text }+,
            (text|anyElement)*)
       | (attribute * { text }*,
          (text?, anyElement+, (text|anyElement)*))
      }

   # Other Extensibility

   extensionElement =
      simpleExtensionElement | structuredExtensionElement

   undefinedAttribute =
     attribute * - (xml:base | xml:lang | local:*) { text }

   undefinedContent = (text|anyForeignElement)*

[Page 41]

   anyElement =
      element * {
         (attribute * { text }
          | text
          | anyElement)*
      }

   anyForeignElement =
      element * - atom:* {
         (attribute * { text }
          | text
          | anyElement)*
      }

   # XHTML

   anyXHTML = element xhtml:* {
      (attribute * { text }
       | text
       | anyXHTML)*
   }

   xhtmlDiv = element xhtml:div {
      (attribute * { text }
       | text
       | anyXHTML)*
   }

   # EOF

Authors' Addresses

   Mark Nottingham (editor)

   EMail: mnot@pobox.com
   URI:   http://www.mnot.net/


   Robert Sayre (editor)

   EMail: rfsayre@boswijck.com
   URI:   http://boswijck.com

[Page 42]

Full Copyright Statement

   Copyright (C) The Internet Society (2005).

   This document is subject to the rights, licenses and restrictions
   contained in BCP 78, and except as set forth therein, the authors
   retain all their rights.

   This document and the information contained herein are provided on an
   "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
   OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
   ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
   INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
   INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Intellectual Property

   The IETF takes no position regarding the validity or scope of any
   Intellectual Property Rights or other rights that might be claimed to
   pertain to the implementation or use of the technology described in
   this document or the extent to which any license under such rights
   might or might not be available; nor does it represent that it has
   made any independent effort to identify any such rights.  Information
   on the procedures with respect to rights in RFC documents can be
   found in BCP 78 and BCP 79.

   Copies of IPR disclosures made to the IETF Secretariat and any
   assurances of licenses to be made available, or the result of an
   attempt made to obtain a general license or permission for the use of
   such proprietary rights by implementers or users of this
   specification can be obtained from the IETF on-line IPR repository at
   http://www.ietf.org/ipr.

   The IETF invites any interested party to bring to its attention any
   copyrights, patents or patent applications, or other proprietary
   rights that may cover technology that may be required to implement
   this standard.  Please address the information to the IETF at ietf-
   ipr@ietf.org.

Acknowledgement

   Funding for the RFC Editor function is currently provided by the
   Internet Society.

[Page 43]

  1. The Atom Syndication Format - Reference Document
  2. The Atom Syndication Format - Part 2
  3. The Atom Syndication Format - Part 3
  4. The Atom Syndication Format - Part 4

Selected Developer Jobs:

More...