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

Re: Specifying formal semantics in XML languages

  • To: xml-dev@l...
  • Subject: Re: Specifying formal semantics in XML languages
  • From: peter murray-rust <pm286@c...>
  • Date: Tue, 20 Jun 2006 12:25:32 +0100

Re:  Specifying formal semantics in XML languages
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  


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-2007 All Rights Reserved.