Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] A single, all-encompassing data validation language- good or bad for the marketplace?

From: Philippe Poulard <Philippe.Poulard@------.-----.-->
To: "Costello, Roger L." <costello@-----.--->
Date: 8/3/2007 3:01:00 PM
Hi,

Playing with Schematron with W3C XML Schema in separate steps or with 
annotations or in a way such as the latter adopts the former won't 
change anything : you'll still have more or less a separation of them, 
and they will cooperate in the same manner than today : check the 
grammar then check the assertions, or perhaps the opposite ?

The major drawback is that Schematron can't act on the content model 
instead of what does grammar-based schema (that build them) ; thus, if 
an editor will propose to the user to insert some elements, maybe few of 
them will be rejected by Schematron after inserting them

The key point is how content models are built : as schema instances are 
hard-coded XML documents, abstract trees built by schema processors are 
statics ; why not making them dynamic ?

I saw in this list some intersting examples about co-occurrence 
constraints and algorithmic validation, taken from www.xfront.com
for example :
<Document classification="confidential">
   <Para classification="unclassified">
      One if by land, two if by sea;
   </Para>
   <Para classification="confidential">
      And I on the opposite shore will be,
      Ready to ride and spread the alarm
   </Para>
   <Para classification="secret">
      Ready to ride and spread the alarm
      Through every Middlesex, village and farm,
   </Para>
   <Para classification="top-secret">
      For the country folk to be up and to arm.
   </Para>
</Document>
The 2 last <Past> are invalid because the classification level must be 
under "confidential", as it has been specified on <Document>

I made a single schema somewhat simple that build dynamically the list 
of text values for the attribute :
-"confidential", "unclassified" are the allowed values in this case
My schema simply report a "bad attribute value" for the <Para>s in fault

if "top-secret" had been specified on <Document>, the list would be :
-"top-secret", "secret", "confidential", "unclassified"

here is the stuff :
http://reflex.gforge.inria.fr/tutorial-schemas.html#classificationLevel
You can download the engine and run it yourself...

There was another example :
<ElectionResultsByPercentage>
     <Candidate name="John">61</Candidate>
     <Candidate name="Sara">24</Candidate>
     <Candidate name="Bill">15</Candidate>
</ElectionResultsByPercentage>
the constraint is that the sum of percentage must be 100

I designed a schema that impose a <Candidate> element if the sum is not 
yet reached, and that report an error if the sum is exceeded ; in all 
cases, the job is done in the content model
http://reflex.gforge.inria.fr/tutorial-schemas.html#activeSchemaAlgo

The last but not the least, there are still things that can't be done by 
Schematron (and neither by W3C XML Schema nor Relax NG nor DTD) ; for 
example, to design semantic data types
Here is an example of what is possible :
http://reflex.gforge.inria.fr/tutorial-schemas.html#psvi

There is a new way to make schemas, this is the Active Schema Language :
ASL can build active content models, that is to say content models that 
can adapts themselves according to the input to validate.
Doing these things dynamically is much more powerful and efficient than 
the traditional approach.

I will talk few minutes about the Active Schema Language at Extreme 
Markup Language next week :
http://www.extrememarkup.com/2007/abstracts.html#t400r

-- 
Cordialement,

               ///
              (. .)
  --------ooO--(_)--Ooo--------
|      Philippe Poulard       |
  -----------------------------
  http://reflex.gforge.inria.fr/
        Have the RefleX !


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent