XML technologies / RSS & Atom / OPML
(Excerpt from "Newsfeeds with RSS and Atom" by Heinz Wittenbrink, published by Galileo Press, 2005)
The Outline Processor Markup Language (OPML) is an exchange format for lists of newsfeeds. It is mainly used to export newsfeed addresses from aggregators or import them into aggregators. Unlike the feed formats introduced here, OPML allows hierarchies of arbitrary depth. Users can group newsfeeds, group those groups, and so on.
The following sample document was generated by an export from NetNewsWire. (It has been slightly shortened.)
<?xml version="1.0" encoding="ISO-8859–1"?>
<opml version="1.1">
<head>
<title>mySubscriptions</title>
</head>
<body>
<outline text="Web" title="Web">
<outline text="Technik" title="Technik">
<outline text="Ars Technica" description="Ars Technica:..." title="Ars Technica" type="rss" version="RSS" htmlUrl="http://arstechnica.com" xmlUrl="http://arstechnica.com/etc/rdf/ars.rdf"/>
<outline text="Apache Week" description="Apache Week:..." title="Apache Week" type="rss" version="RSS" htmlUrl="http://www.apacheweek.com/" xmlUrl="http://www.apacheweek.com/issues/apacheweek-headlines.xml"/>
</outline>
<outline text="Design" title="Design">
<outline text="Digital Web Magazine - What's New" description="Digital Web Magazine - What's New: http://www.digital-web.com/" title="Digital Web Magazine - What's New" type="rss" version="RSS" htmlUrl="http://www.digital-web.com/ " xmlUrl="http://www.digital-web.com/new/rss.php"/>
<outline text="A List Apart" description="A List Apart: Web design news, info, and insights since 1995..." title="A List Apart" type="rss" version="RSS" htmlUrl="http://www.alistapart.com/" xmlUrl="http://www.alistapart.com/articles.rdf"/>
</outline>
</outline>
<outline text="Politik" title="Politik">
<outline text="NETZEITUNG.DE" description="NETZEITUNG.DE: Aus Prinzip schneller" title="NETZEITUNG.DE" type="rss" version="RSS" htmlUrl="http://www.netzeitung.de" xmlUrl="http://www.netzeitung.de/export/news/rss/titelseite.xml"/>
<outline text="news.ORF.at" description="news.ORF.at:..." title="news.ORF.at" type="rss" version="RSS" htmlUrl="http://news.orf.at" xmlUrl="http://rss.orf.at/news.xml"/>
</outline>
</body>
</opml>
Code example: sample OPML document
The following illustration shows this document’s structure:
Figure: structure of an OPML document
The document element opml has two descendants named head and body. The descendants of body are named outline. An element outline can occur inside an element of the same name. An element outline can be nested to any depth inside elements of the same name; it can be used recursively.
Elements named outline are characterized by attributes. The following illustration shows the structure of one of the outline elements in the example:
Figure: attributes of the outline element in an OPML document
Dave Winer describes OPML in the OPML 1.0 Specification from 2000. OPML documents can describe outlines (outline means a structured outline) of any kind. The element head plays no important role in newsfeeds. body serves only as a container for elements of type outline.
outline has several attributes defined in the specification; of these, type identifies the content type. Another attribute defined in the specification and also found in the example above is text. The value of text is a string displayed when the document is viewed or edited in outlining software.
The format’s key feature is that additional attributes can be used beyond those already defined. Their names and permitted values depend on the application domain. In the example above, these are the attributes description, htmlUrl, xmlUrl and version.

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.