July 18, 2003

Schema for Echo

Tim Bray writes:

I cooked up a RelaxNG schema for Pie/Not-Echo or whatever you want to call it, in its 0.1 snapshot form. Which, as a side-effect, generates a W3C XML Schema.

[ Tim Bray - Schemaware for Pie 0.1 ]

The schema generated from the RelaxNG master doc is here.

Here's some comments and feedback on this schema, based on my past experiences with a schema for RSS 2.0:

  1. The main simplification in Tim's schema is the restriction that all elements must be present in the order defined in the schema (that's what the <sequence> under the "entry" element definition does).
    This was one of the biggest problems I hit with the RSS 2.0 schema - it was already baked in to the accepted usage patterns and custom that ordering was not fixed, and as a result I had to build up a convoluted structure involving a <sequence> of <choice> items. This creates a huge amount of complexity in the RSS 2.0 schema, and strictly speaking does not even enforce the required constraints (such as only one <title> element).
    The interesting question is whether this "any order" flexibility should be sacrificed for a simplified and more deterministic schema?  Personally, I would say yes a fixed order would be a worthwhile compromise, but I expect there will be pushback from several quarters here.
  2. There is no provision for extensibility items in the schema.
    Again, this was one of the hard aspects to incorporate into the RSS 2.0 schema, and required all sorts of hoops to be jumped through to arrive at a deterministic schema.
    I think this will definitely need to be present in the final version, as per the discussion on the SyntaxExtensionMechanism in the Echo wiki, but obviously can usefully be skipped at the v0.1 prototype stage.
  3. To make a schema easier to reuse and extend, I have found it preferable to declare explicit named complex types and keeping the <element> declarations separate. Having said that, Don Box prefers it the other way round, so this is somewhat a personal taste decision at the end of the day.

Incidentally, none of this is intended as disrespect for Tim's efforts, just constructive feedback. It's also worth bearing in mind that Tim's schema is auto-generated from the RelaxNG doc, rather than being hand crafted.

From my own experience with the RSS 2.0 schema, I completely agree with Tim's comments that many things are just way harder to achieve with XML Schema than they should be, and some things that you would think should be doable are just plain impossible.

Entry categories: RSS Standards XML
Posted by Jorgen Thelin at July 18, 2003 11:49 PM - [PermaLink]
 
Traceback List