OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] 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]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS