[Home] [By Thread] [By Date] [Recent Entries]
On Fri, Nov 13, 2015 at 9:48 PM, Costello, Roger L. <costello@m...> wrote: > Hi Folks, > > Have you written a program to generate a list of assertions about an XSD? > Yes, very recently - using XSLT 2.0 to generate XSD 1.1 with embedded assertions from an XSD 1.0 'base' schema. The schema is for a configuration file where each leaf-element either has a 'literalValue' attribute or a 'parameterRef' attribute. Assertions are generated for 'parameterRef' to ensure that the type of the referenced parameter (defined elsewhere in the XML instance) is consistent with that defined in the XSD for the 'literalValue'. (Normal XSD unique key reference constraints are still used to ensure referential integrity). Auto-generating the assertions saved a lot of manual effort and of course means that the assertions are re-generated properly each time the schema design is updated. A side-benefit is that saxon:message and xerces:message extension attributes can also be auto-generated with descriptions of the location of the assertion error and the expected type. (These message attributes are shown by the oXygen XML editor when an assertion test fails during editing). Phil
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |

Cart



