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

Re: Why is there no schema for RSS?


rss schemas
From: "Tim Bray" <tbray@t...>

> Many on this list will find it shocking, but lots of important XML 
> dialects don't have any DTDs or schemas.  Particularly in the 
> application-glue space.  People email back and forth some examples, they 
> cut some code, and then everything's working and they're too busy to go 
> back and write a schema.

Three reasons which may contribute to this:

1) If a schema language is not powerful enough to capture the actual
structures in some data, which may be non-regualar, then shoehorning the
structures into a schema will be extra work.

2) If the schema language (and associated tools) do not allow people
to go from emailed statements to rules conveniently, then the schema
will get out-of date in the absense of strong management.

3) When the schema language and schema starts with a fairly open
structure, and people can add more constraints, then there can be
a maintenance lag (for restrictions) without causing spurious failures.
In contrast, when the schema starts with unnessecary restrictions, it
won't handle a maintenance lag.  For example, I could start off with
  (x:a, x:b, x:c)
as the content model  that is very closed. On the other hand, I could start off 
with the generous
  (#ANY*, x:a, #ANY*, x:b, #ANY*, x:c, #ANY*)
i.e. allowing any elements in between the existing elements,
then it will be compatible with any extension that comes along. 
One of the design decisions for a schema language is whether you expect
this is an edge case that can be given a cumbersome syntax (e.g. WXS)
or a common case that can be simple to do (e.g. Schematron). 

Even in Schematron it is perfectly possible to write a schema that is not
"generous" (open).  A generous rule would be something like
  <assert test="x:a">There should be an x:a</assert>
  <assert test="x:b">There should be an x:b</assert>
  <assert test="x:c">There should be an x:c</assert>
  <assert test="x:c[previous-sibling::x:b[previous-sibling::x:a]]"
        >x:a, x:b, x:c should appear in that order.</assert>

while a miserly (closed) rule would be
  <assert test="*[1][self::x:a]">Element 1 is an x:a</assert>
  <assert test="*[2][self::x:b]">Element 1 is an x:b</assert>
  <assert test="*[3][self::x:c]">Element 1 is an x:c</assert>
  <assert test="count(*) = 3">There can only be three elements</assert>

Cheers
Rick Jelliffe

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.