Created
September 17, 2014 07:34
-
-
Save jonelf/188343b2070354a00513 to your computer and use it in GitHub Desktop.
Validera personnummer i XPATH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(validate-dateTime("yyyyMMdd", left($pnum, 8 ))) | |
and | |
(((number(substring($pnum,3,1))*2) mod 9 + (floor(number(substring($pnum,3,1)) div 9)*9) + (number(substring($pnum,4,1))) + | |
(number(substring($pnum,5,1))*2) mod 9 + (floor(number(substring($pnum,5,1)) div 9)*9) + (number(substring($pnum,6,1))) + | |
(number(substring($pnum,7,1))*2) mod 9 + (floor(number(substring($pnum,7,1)) div 9)*9) + (number(substring($pnum,8,1))) + | |
(number(substring($pnum,9,1))*2) mod 9 + (floor(number(substring($pnum,9,1)) div 9)*9) + (number(substring($pnum,10,1))) + | |
(number(substring($pnum,11,1))*2) mod 9 + (floor(number(substring($pnum,11,1)) div 9)*9) + (number(substring($pnum,12,1))) | |
) mod 10 = 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment