[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Harmonising RSS-* and Atom - solving interoperability problems with mode

  • To: xml-dev@l...
  • Subject: Harmonising RSS-* and Atom - solving interoperability problems with modern schema languages
  • From: Sean McGrath <sean.mcgrath@p...>
  • Date: Wed, 31 Mar 2004 20:52:54 +0100

atom xml schema
All,

It seems to me that modern schema languages such as RelaxNG and W3C
XML schema, have a significant role to play in simplifying data
inter-operability and helping us move away from incessant disagreements
about data models that plagued the DTD years.

As an example of what can be achieved, and as a discussion piece, I
have created a schema that allows *all* versions of RSS and the
newer Atom notation to all conform to a single, simple schema. I'm convinced
that this harmonization will make life a lot easier for syndication tool
creators and feed creators alike.

I have included Relax NG compact syntax, Relax NG and W3C XML Schema
versions.

(The is no DTD version because DTDs lack the all important attribute wild 
carding capability
of modern schema languages. A capability that is vital to the power of this 
technique - especially
in the namespace-centric world we live in.)

Here is a fragment of RSS 1.0 for example:
         <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
         <items>
         <rdf:Seq><rdf:li 
rdf:resource="http://localhost:8080/DrRoryOHanlon/000013.html" />
         <rdf:li 
rdf:resource="http://localhost:8080/DrRoryOHanlon/000012.html" />
         <rdf:li 
rdf:resource="http://localhost:8080/DrRoryOHanlon/000004.html" />
         <rdf:li 
rdf:resource="http://localhost:8080/DrRoryOHanlon/000003.html" />
         </rdf:Seq>
         </items>
         </rdf:RDF>

and here is the same document, cross-translated to my interoperability schema:
         <tag type="rdf:RDF" 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
         <tag type="items">
         <tag type="rdf:Seq"><tag type="rdf:li" 
rdf:resource="http://localhost:8080/foo/000013.html" />
         <tag type="rdf:li" 
rdf:resource="http://localhost:8080/foo/000012.html" />
         <tag type="rdf:li" 
rdf:resource="http://localhost:8080/foo/000004.html" />
         <tag type="rdf:li" 
rdf:resource="http://localhost:8080/foo/000003.html" />
         </tag>
         </tag>
         </tag>

Here is the schema. Comments welcome.

-- W3C XML schema --
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
elementFormDefault="qualified">
   <xs:element name="tag">
     <xs:complexType>
       <xs:sequence>
         <xs:element minOccurs="0" maxOccurs="unbounded" ref="tag"/>
       </xs:sequence>
       <xs:anyAttribute processContents="skip"/>
     </xs:complexType>
   </xs:element>
</xs:schema>

-- Relax NG --
<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
   <start>
     <ref name="TAG"/>
   </start>
   <define name="TAG">
     <element name="tag">
       <zeroOrMore>
         <attribute>
           <anyName/>
         </attribute>
       </zeroOrMore>
       <zeroOrMore>
         <ref name="TAG"/>
       </zeroOrMore>
     </element>
   </define>
</grammar>

-- Relax NG Compact Syntax --
start = TAG

TAG = element tag {
         attribute * { text }*,
         TAG *
}

Sean


Sean McGrath
http://seanmcgrath.blogspot.com


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.