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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Specifying formal semantics in XML languages

[ Lists Home | Date Index | Thread Index ]

At 09:53 20/06/2006, Rick Jelliffe wrote:
>There are indeed many useful kinds of schema languages that don't 
>have widespread currency yet.

Many thanks Rick

This is very useful - if nothing else it reassures me I am on a 
reasonable track.
>In some of my company's products we use our own little schema 
>language that says
>
>* what elements are allowed or required
>* what attributes are allowed or required
>* what elements are only every found in first or last position
Yes..


>We also have "usage schemas" which sample documents and generate all 
>the possible grandparent/parent/child paths in the document, and 
>checks other documents against these.
>
>Checking lists of tokens is indeed a very problematic area for 
>Schematron using the default XSLT 1 implementations.

Agreed.

>ISO DSDL was created to give a home and official status to these 
>kind of little languages. If anyone can come up with a technically 
>excellent and implemented little schema language that helps validate 
>some significant kinds of markup idioms that XSD or the other ISO 
>DSDL schema languages do not cover well (as is *entirely* possible), 
>I am certain the ISO SC34 WG1 group would be interested in 
>considering it for standardization.

I am not a great fan of developing things through ISO - I have sat on 
ISO ctte and the speed is extremely slow. I am less concerned about 
post-acceptance. But I am actually hoping that there are others who 
are interested in doing this as well.



>To be honest, I suspect that Schematron with a particular extension 
>could pretty much do what Peter requires. In particular, ISO 
>Schematron has a macro facility called abstract patterns that allow 
>you to be much more declarative in labelling the participants in a 
>schema relationship: you could have one like

Good. This may be useful to pursue. If it is lightweight and useful I 
would be prepared to write my own implementation.


><sch:pattern name="required-child" abstract="true">
>    <sch:rule context="$parent">
>      <sch:assert test="$child">The parent should have a child</sch:assert>
>   </sch:rule>
></sch:pattern>

$foo seems to be an argument of some sort

>  <sch:pattern name="eg"  is-a="required-child">
>      <sch:param name="parent" value="Angela"/>
>     <sch:param name="child" value="Suhai"/>
>     <sch:param name="position" value="1" />
>  </sch:pattern>
>
>What this gives is enough markup that  a custom processor can take 
>the schema and
>generate  code based on it. For example, to append a Suhai element 
>to the Angela
>element in the first position.

Yes

>Abstract patterns represent, I hope, a significant advance in 
>home-made schema languages, because not only do you get the 
>background boring power of XPath validation, but you also get the 
>extra labelling required to enable identification of the parts of 
>constraints and assertion
>tests. And that identification opens the door for re-targetting the 
>schema for purposes such as code generation or any kind of useful 
>purpose. XPaths are great because they are terse; abstract patterns 
>overcome the concomitant lack of declative expressiveness.

Absolutely agreed. I think the main problem is simply enough courage 
to pursue this.

P.


>Cheers
>Rick
>
>
>
>
>Peter Murray-Rust
>Unilever Centre for Molecular Sciences Informatics
>University of Cambridge,
>Lensfield Road,  Cambridge CB2 1EW, UK
>+44-1223-763069  





 

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

Copyright 2001 XML.org. This site is hosted by OASIS