This should be straight forward but I am struggling. I have a simple one
table data base connection to "shipments" When someone enters a new
shipmentID I'd like to make sure that it is unique within the shipments
displayed in a repeating table (not necesarily all shipments in the database)
My XPATH expression to validate is: count(\\Shimpent\@ShipmentID[.]) >1 but
it does not seem to return the right results.
Thanks for your help
IT PHYTOSAN
Your slashes are in the wrong direction, and you need the current() function.
See if this works any better: count(//Shimpent/@ShipmentID[. = current()/@ShipmentID]) >1

Signature
Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )
IT PHYTOSAN - 01 Aug 2006 01:23 GMT
Thank you very much for your help.
Per your advice I have changed the expression. Please note that I am using
actual fields and not those used in the previous example. Embarque are
shipments and AndenIDMuestreo are loading docks.
count(//Embarque/@AndenIDMuestreo[. = current()/@AndenIDMuestreo]) > 1
Upon loading the form I get the following error:
The form definition (.xsf) file contains the following error:
Illegal "expression" expression:
self::node()[count(//Embarque/@AndenIDMuestreo[. =
current()/@AndenIDMuestreo]) > 1]
Unknown method.
self::node()[count(//Embarque/@AndenIDMuestreo[. =
-->current()<--/@AndenIDMuestreo]) > 1]
Please note that I am using IP2007 Beta 2
Thanks for your help
IT PHYTOSAN
> Your slashes are in the wrong direction, and you need the current() function.
>
> See if this works any better: count(//Shimpent/@ShipmentID[. = current()/@ShipmentID]) >1