# Thursday, January 15, 2004

I'm currently working on doing some instrumenting for the sake of unit testing (using NUnit) and was doing some thinking about Schematron.  I haven't heard much about it lately, and I don't know if people are going forward with it, but it's a pretty compelling idea. 

For those of you who haven't looked into it, Schematron allows you to define assertions based on XPath expressions that can be used to validate XML documents, over and above what XML Schema provides.  For example, if your business logic specifies that for any given order, a retail customer can only have purchases totalling $100, that's something that you can't really specify in XSD, since it involves cross-element rules, but you can with Schematron. 

Anyway, I happen to have XML serialized versions of the objects I'm interested in lying around, so I could create a shim that would work with NUnit to do Schematron validation (using Schematron.NET).  However, I might not always have XML around.  It would be pretty cool if you could do the same kind of declarative validation of objects.  I wonder if ObjectSpaces will facilitate something like that??

Work | XML