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

Re: property dependency checking


squeeze dependencies
From: "Rick Jelliffe" <ricko@a...>
> Your constraints would be specified in Schematron like this:
>
> <rule context="prop1[text()='ABC']" >
>     <assert test="following-sibling::*[1][self::prop2]">
>     When the value of "prop1" is ABC then "prop2" should follow "prop1"
>     </assert>
> </rule>
>
> <rule context="prop1[text()='XYZ']" >
>     <assert test="following-sibling::*[1][self::prop3]">"
>     When the value of "prop1" is XYZ then "prop3" should follow "prop1"
>     </assert>
> </rule>

Since when are attributes order-constrained?

> Note that you have expressed your constraints in a form that
> can be used directly to drive the assertions you want to make.
> Rather than trying to squeeze them into the form of a grammar,
> you can just use translate your XPaths fairly directly.  This is
> commonly the case with Schematron assertion.

What an interesting world-view! If you "squeeze" constraints into the form
of a grammar you and others can visualize the structure of the document,
i.e., the things that can be said. If you squeeze grammar into the form of
constraints you just have a list of things that can't be said.

Of course, grammars plus assertions are more powerful than grammars alone.
No argument there. And XSD/RELAX NG + Schematron is a very appealing
combination. But my world-view is that anything that can be specified by a
grammar should be. Grammars are constructive. They can, and commonly are,
used to generate user assistance to document authors, forms for data entry
and readable documentation. Can't do that with assertions.

>There is a free drag-and-drop validator for XSD, RELAX NG and Schematron
>for Windows at http://www.topologi.com/

And very nice it is!

Bob


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