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

Re: Rick Jelliffe quotable quote on the purpose of schemas

  • From: Philippe Poulard <Philippe.Poulard@s...>
  • To: "Costello, Roger L." <costello@m...>
  • Date: Mon, 11 Dec 2006 15:34:44 +0100

Re:  Rick Jelliffe quotable quote on the purpose of schemas
Costello, Roger L. wrote:
> "Schemas are not about making grammars; schemas are about expressing the 
> most significant constraints and patterns in your XML document."
>                                                  -- Rick Jelliffe

I do agree.

Grammars are not the goal, they are just means. *Poorly means*.

Quoting myself :
"The flaw with grammars is that they only allow to constraint content 
models in a declarative manner, which is in essence very concise and 
expressive, but when you reach the limits of your declarative syntax, 
there are no ways out ; you can still add a new tag to express the 
missing declarative tag, but the limit still exists a single step further."

A schema processor will build an abstract tree from the schema instance. 
With a traditional grammar-based schema (DTD, W3C XML Schema, Relax NG), 
as the schema instance is *hard-coded*, the abstract tree remains *static*.

What will you do if you can't express a constraint with a grammar ?
-ignore the constraint
-check it programmatically
-change the structure

I don't want my structure to be governed by a schema, I just want the 
schema to validate my structure ; if a schema fails to validate one of 
my constraints, why should I have to change my structure ? I want to 
decide how my structure looks like.

There are many examples of things that you can't express with 
grammar-based schemata, such as co-occurrence constraints ; sometimes, 
an additional tool such as schematron will fill the blanks ; however, 
schematron won't supply a contextual content-model and other things 
can't be achieved with it, such as defining a semantic data type ; this 
is another flaw of schemata : most of programming language provide means 
to design and handle semantics data types, but in the XML world, it's 
impossible !

We can do much more better than grammar-based schema : the *Active 
Schema Language* (ASL) is an hybrid schema language that will allow you 
*to mix declarative content models with imperative instructions*.
At runtime, *the abstract tree is dynamic*, and can be evaluated 
according to the datas you are validating, which increases dramatically 
the expressiveness of the schema.


here is the spec :
and the implementation :

some examples in the tutorial section :

1) a very simple example that uses XPath and an if-then-else statement 
within a content model :

2) another very simple example that shows how to define a semantic data 
type, and how to bind a typed data to an attribute value (PSVI) :

of course, these examples are showing things that are impossible to 
express with other schemata, except schematron that could check the 
constraint in example 1), but schematron doesn't act in the same manner, 
it doesn't define a content model


              (. .)
|      Philippe Poulard       |
        Have the RefleX !

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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.
First Name
Last Name
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.