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

Best Practice - beyond schema

  • To: "Xml-Dev" <xml-dev@l...>
  • Subject: Best Practice - beyond schema
  • From: "Paul Spencer" <paul@a...>
  • Date: Mon, 17 Jun 2002 15:01:14 +0100
  • Cc: "Roger L. Costello" <costello@m...>
  • Importance: Normal

switch schema
There are two reasons for needing to go beyond XML Schema on a project
that is using XML Schema as its base constraint syntax. The first is
where XML Schema cannot express the constraints required, for example,
a section of a message that is required if the value of a previous
element is "yes", but not if it is "no". Languages such as Schematron
go some way to address this and can be used either embedded in an XML
Schema schema or as free-standing documents. I will shortly be making
recommendations in this area to the UK Govt, and would welcome a
discussion here at some point.

The other situation, and the one that is a more immediate concern, is
the situation where we need to localise a general purpose schema. A
good example, since this is an OASIS-hosted group, is the Election
Markup Language (EML) on which I have been working. This is an
international collaboration, so most elements are optional, although
they might be required in a particular situation. For example, some
audit information is required in a UK parliamentary election but
forbidden in a US gubernatorial or presidential election. It is
optional in the schema, but mandatory for the UK and forbidden in the
USA. This requirement for profiling schemas is common, but not one I
have seen addressed in open discussion. Here are two ways of
approaching it:

Write new, more restrictive, schemas for each regime such that a
document that validates to the local schemas will validate to the
global schema (but not necessarily vice versa). This has the advantage
that only a single schema processor is required, and it will be an XML
Schema processor - something that Governments are generally happy
with, while they will be less happy with Schematron or RELAX NG
processors. It is also easier to read and understand, since a single
schema describes each message. The disadvantage is that we alter the
schema document itself, giving us a configuration management headache.
Even using derivation, there will be a lot of work developing and
checking any new version of the local variant when a new global
version is released.

or

Use an open (open in terms of allowing any content that is not
expressly forbidden) schema language to supplement the closed XML
Schema schema. Each document will then be validated to the XML Schema
schema, then passed on to the second schema processor for the local
variations. The advantage is that we do not modify the globally agreed
schema. This eases configuration management and conformance checking
and means that international systems providers only work with a
specific set of schema documents for the additional local constraints,
making their job easier. The disadvantage is that we need to operate
two schema processors in series, which adds an additional technology
and an additional processing overhead. Some of the applications I work
on are very high volume, so this can be an issue.

I suspect that the former is the short-term pragmatic solution, whilst
the latter is the better strategic answer if the technology (in terms
of common tools to develop and view two schema languages
simultaneously etc) is put in place. How about a tool that provides
the graphical editing environment of XML Spy whilst allowing the
developer to switch schema language for specific sets of constraints.
i.e. I could import an EML schema written in XML Schema, then work on
the graphical representation, generating a separate Schematron file
whilst leaving the original schema document intact.

I throw the discussion open to the floor.

Paul Spencer
XML Adviser to the Office of the e-Envoy


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.