unique field constraints are being required
Posted: Sat Nov 15, 2003 1:10 am
Hi George,
Looks like your keeping busy
I have a problem/question with declaring a field unique:
<xsd:unique name="fooConstraint" xmlns:o="my.foo.namespace">
<xsd:selector xpath="o:someNode/o:someOtherNode"/>
<xsd:field xpath="@foo"/>
<xsd:field xpath=".//childNode/@bar"/>
</xsd:unique>
returns the error:
Not enough values specified for the <unique> identity constraint specified for element "grid".
for the xml
<o:grid xmlns:o="my.foo.namespace" ...>
</o:grid>
Either of the constraint fields alone allow the uniqueness constraint to be satisfied if no nodes match the xpath with the specified fields as required, but having two or more constraint fields returns this error if all the fields don't exist, which should be the behavior of <key> not <unique>.
Thanks for your input and have a nice weekend.
Thatcher
Looks like your keeping busy

<xsd:unique name="fooConstraint" xmlns:o="my.foo.namespace">
<xsd:selector xpath="o:someNode/o:someOtherNode"/>
<xsd:field xpath="@foo"/>
<xsd:field xpath=".//childNode/@bar"/>
</xsd:unique>
returns the error:
Not enough values specified for the <unique> identity constraint specified for element "grid".
for the xml
<o:grid xmlns:o="my.foo.namespace" ...>
</o:grid>
Either of the constraint fields alone allow the uniqueness constraint to be satisfied if no nodes match the xpath with the specified fields as required, but having two or more constraint fields returns this error if all the fields don't exist, which should be the behavior of <key> not <unique>.
Thanks for your input and have a nice weekend.
Thatcher