Sign In/My Account | View Cart  
advertisement

Article:
 Combining RELAX NG and Schematron
Subject: Combining schema languages
Date: 2004-02-23 11:38:43
From: Eddie Robertsson
Response to: Combining schema languages

Hi Mark,


I haven't looked at XForms but I have played around with WXS and Schematron. It works pretty much the same as Relax NG and Schematron and the two differences are:


1) The Schematron declarations are embedded within the xs:appinfo element.


2) You use a different extractor stylesheet to extract the Schmematron declarations (XSD2Schtrn.xsl). The stylesheet is available here:
http://www.topologi.com/public/Schtrn_XSD/XSD2Schtrn.zip


No Previous Message Previous Message Move up to Parent Message Up Next Message No Next Message


Titles Only Titles Only Newest First
  • Combining schema languages
    2004-02-27 05:47:18 Mark Seaborne

    Eddie,


    Okay, that's an interesting approach.


    If you used XForms you leave the schema alone, but reference it in an XForms model:


    <xfm:model id="myModel" schema="mySchema.xsd">


    You then define Model Item Properties that add additional constraints:


    <xfm:bind nodeset="purchaseOrder/items/item" constraint="number(price) * number(quantity) = number(totalAmount)"/>


    In addition to constraint, you can use "calculate", "relevant", "required", "readonly", "type" (apply a WXS type) and "p3ptype"


    XForms' instance() function allows you to define MIPs that involve multiple XML instances, if you so wish.


    I quite like the fact that the XForms model is non-intrusive, allowing you to build on a schema without needing read access to the schema.


    However you do it though, it is undoubtedly useful to be able to express


    All the best


    Mark





Sponsored By: