Next in thread → Next in month →

Re: [xml-dev] Got a program that generates a list of assertions about an XSD?

From
Philip Fearon <>
To
"Costello, Roger L." <>
Date
2015-11-16T17:57:51Z
ID
<CADV2FzTU1sdA_95DxqST3G=>
Thread
Re: [xml-dev] Got a program that generates a list of assertions about an XSD?
On Fri, Nov 13, 2015 at 9:48 PM, Costello, Roger L. <> 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
Next in thread → Next in month →