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

Re: XML Schemas: Best Practices

  • From: Eddie Robertsson <eddie@a...>
  • To: Rick Jelliffe <ricko@a...>
  • Date: Wed, 07 Mar 2001 11:00:43 +1100

sch diagnostic
 

Rick Jelliffe wrote:

That is an interesting paper.

I am surprised there is no treatment yet of the Extension framework that
Extensiblity developed. Also, Schematron does allow you to specify the
values of A and B, but in a separate section "diagnostics" which would
presumably appear in the appinfo for the top-level schema.

Yes, I've found the diagnostics functionality very useful since it allows you to use the very powerful value-of function in XSLT which means you can display just about anything you want (learning to master the diagnostic function probably take you another 30 min or so ;-)). Here's an example:

<sch:rule context="d:Demo">
   <sch:assert test="d:A > d:B" diagnostics="d1">Error!!!  A must be greater than B</sch:assert>
</sch:rule>

In the assert (or report) element you add the attribute diagnostics which is a reference to one or more diagnostic elements in a diagnostics section. In this case:

<sch:diagnostics>
   <sch:diagnostic id="d1">Value of A is <sch:value-of select="d:A"/> and value of B is <sch:value-of select="d:B"/>.</sch:diagnostic>
</sch:diagnostics>

Note, that the basic stylesheet (schematron-basic.xsl) doesn't support the diagnostics function however, it's easy to write your own stylesheet that extends skeleton1-5.xsl to support diagnostics [1].

[1] www.allette.com.au/Demo/XSD_Schtrn/schematron-basic-eddie.xsl

In order to use the diagnostics functionality you have to provide a command line argument diagnose=yes.

Cheers,
/Eddie


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.