xs:assert in Schema 1.1
Posted: Thu Dec 05, 2013 10:42 am
Hello,
usually I work with two Elements: »Lernziele« and »Einführung«. I would like to use the xs:assert to give an error indication, if someone choose one of them twice. You see it below.
If I test »Lernziele« this way, everything is OK. If I test »Einführung« there is an error:
E [Xerces] cvc-xpath.3.13.4.2a: XPST0003 - Assertion XPath expression ('count(le:Einführung) le 1') on the schema type 'defKapitel' couldn't compile successfully.
If I change »Einführung« to »Einfuhrung«, everything is OK - but then I have a new problem - a semantic one ...
Best regards
Ulrike Borinski
usually I work with two Elements: »Lernziele« and »Einführung«. I would like to use the xs:assert to give an error indication, if someone choose one of them twice. You see it below.
Code: Select all
<xs:complexType name="defKapitel">
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="2">
<xs:element ref="le:Einführung"/>
<xs:element ref="le:Lernziele"/>
</xs:choice>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="le:Textebene-1"/>
</xs:sequence>
<xs:assert test="count(le:Einführung) le 1"/>
</xs:complexType>
E [Xerces] cvc-xpath.3.13.4.2a: XPST0003 - Assertion XPath expression ('count(le:Einführung) le 1') on the schema type 'defKapitel' couldn't compile successfully.
If I change »Einführung« to »Einfuhrung«, everything is OK - but then I have a new problem - a semantic one ...
Best regards
Ulrike Borinski