Hi Władysław,
You can do this type of validation with XPath. For instance, I put below
some XPath I wrote in the past to validate the Swiss OASI Number. That one
is a 13-digit number, and the check in the last digit (like PESEL), and it
follows the EAN-13 regulations (not sure about PESEL). Here is the code fo
the Swiss OASI Number, an I hope this can help:
let
$digits := translate(., '.', ''),
$multiplied :=
for $pos in 1 to 12
return
let $multiplier := if ($pos mod 2 = 1) then 1 else 3
return xs:decimal(substring($digits, $pos, 1)) *
$multiplier,
$total := sum($multiplied),
$check := 10 - ($total mod 10),
$last-digit := xs:decimal(substring($digits, 13, 1))
return
$last-digit = $check
-Alex
-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from:
http://discuss.orbeon.com/