[xsde-users] Adding unique constraint to an xsd

Boris Kolpackov boris at codesynthesis.com
Tue Oct 18 11:43:17 EDT 2016


Hi Jonathan,

Jonathan Ball <Jonathan.Ball at domino-uk.com> writes:

> We have added a constraint such that the ID of polymorphic elements
> is unique across all instances of those elements.  When encountering
> duplicated IDs, XSD/e does not raise an error - is this supported on
> XSD/e?
> 
> Code snippet:
>     <xs:element name="root" type="FOO:Root">
>        ...
>         <xs:unique name="uniqueContentIdentifier">
>             <xs:selector xpath=".//FOO:Type1 | .//FOO:Type2 | .//FOO:Type3" />
>             <xs:field xpath="@id"/>
>         </xs:unique>
>         ...
>     </xs:element>

No, such constraints are not checked. That would require too much
memory/object code for XSD/e.

Boris



More information about the xsde-users mailing list