Now, I have a list of defined SubType enums but even more specifically, I want to be able to have rules regarding the "type" attribute of the SubNode. Say I have type0, type1, type2 and type3 being the valid enums. But since a SubNode can have one or more SubNode child nodes, I want to specify that a type0 SubNode should have exactly one type1 SubNode child. And that a type1 SubNode should have exactly two type2 SubNode children. And a type2 SubNode should have exactly three type3 SubNode children.
I think I have to use something outside the XML Schema spec...but what? How do I enforce these rules? Schematron? I've never used it...just heard the name.
Subject:Check for valid attribute values based on other attribute values at runtime? Author:Lisa Felten Date:06 Oct 2009 07:47 PM
Thanks, Ivan.
I've since solved my problem by using an XSLT stylesheet instead of trying to use XML Schemas to validate my instance file. XSLT allows for XPath expressions, along with if/choose/when/otherwise tags which facilitate what I needed to do.