Page 1 of 1

unique field constraints are being required

Posted: Sat Nov 15, 2003 1:10 am
by thatch
Hi George,
Looks like your keeping busy :wink: 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

Posted: Mon Nov 17, 2003 5:00 pm
by george
Hi Thatcher,

Thank you for your post. The problem appears only when multifield constrains are used and for some node there are some values for the fields but not for all the fields. As we are using the latest version of Xerces I started a discussion on the xerces-dev list about this issue.

I will post any updates to this forum entry.

Best Regards,
George