Extremely XML

XML is one of the more exciting file formats in the past fwe decades. Rather than just being a convenient way to store information, it tends to open up accessibility to information to more software than any other format in history.

Sunday, August 27, 2006

Apply Schematron constraints to XForms documents automatically

It has been obvious for half a decade or more that much of the GUI programming effort we take for granted in the software industry is just busy work.

As always happens with busy work, sooner or later it gets whacked. Some programmer or corporation locks it in its sites, types in a program to automate the job, and blows it away.

That is just what has happened, or is in the final stages of happening, with GUI forms production.

IBM has released software that generates data-entry validation for state-of-the-art web forms for you.

Apply Schematron constraints to XForms documents automatically:
IBM alphaWorks has released a new round of free tools, including the XML Forms Generator, to accelerate the development of forms that comply to this standard. The recent update lets you apply constraints defined in a Schematron 1.5 document to the generated form. Itself an XML markup, Schematron provides for the specification of business rules and data relationships that XML Schema cannot. While XForms natively provides for validation against XML Schema, any use of Schematron constraints must be built into the form itself.


It is hard to imagine anyone going back to the archaic Resource file format of the Macintosh circa the 1980s, or the Resource Compiler of MS-Windows back in the 1990s.

These days, we pretty much are all using XML or HTML based file formats to define our GUIs. The exception being some Swing forms that are hand programmed in Java using the Swing framework.

XForms is an XML based format and it is much higher-level, and at the same time simpler to use, than the ancient HTML file format. XForms itself was invented over have a decade ago and has been an official web standard for years.

Many companies like IBM are already using it in commercial applications. It helps head off problems which have recently made the national news, where people desperately needed to access a website but did not have a specific version of a specific brand of a specific web browser running on a specific version of a specific operating system.

XML Schemas: the better way

Lots of people use XSD as their sole solution to XML needs because it is so powerful and it is from Microsoft.

Microsoft employees have posted blog entries deploring the unnecessary complexity of XSD. For some of its newest XML file formats, W3 has switched to using other schema languages such as RELAX NG to define the syntax of their files. These other schemas are shorter and more readable too.

What is refreshing about the non-XSD schema community is that they use more modular means of defining/validating their XML file formats than XSD. The schemas are very easy to read/write. They are way simpler for a computer program to process and understand than XSD or even DTD.

Here is a nice set of Schema Design Guidelines I stumbled across on the web this afternoon. The goal is to do the very things I just outlined above as a practice, when defining XML file formats.

XML Schemas: Best Practices

It is a great idea, huh?

Schematron is one of the simplest computer languages I have ever come across. It is an XML-based format for defining validation rules for checking the syntax of a given XML file format.

RELAX NG is easier for people to learn than XSD. Anyone who knows the basics of regular expressions and BNF will have little or no trouble learning it very quickly, especially its Compact form (.RNC file format).

You can probably learn this stuff quicker than you can hand-code your next XSD file from scratch.

Once you have the .RNG grammar file, it is more useful than the .XSD file. Throw in a .SCH (Schematron) rule file - and you are far ahead of that XSD file you are picking away at.

Technorati tags: , , , , , ,

a more elegant approach to validating XML, by using RELAX NG, Schematron, and XVIF

I have had this book about RELAX NG for a few years now.

I just came across a neat description of how to write more efficient, elegant RELAX NG schemas - thus, saving lots of time.

Annotation for Applications