Re: [xsl] XPath MOD 10 calculation

Subject: Re: [xsl] XPath MOD 10 calculation
From: "Jesper Tverskov" <jesper@xxxxxxxxxxx>
Date: Fri, 25 May 2007 11:19:11 +0200
On 5/25/07, Andrew Welch <andrew.j.welch@xxxxxxxxx> wrote:

Running that gave me 7 - when the check digit should be 3 shouldn't
it?  You don't appear to be doing the mod 10 calculations correctly
(according to the steps on wikipedia) - you do the summing, mod 10 it,
take that from 10 and then mod 10 it again.

I hope we are testing different things then. When I copy my code out of my email and into two new files it works well. Also with your <upc>036000291452</upc> example.

My code tests if a UPC is correct based on the checksum, if it is,
nothing is returned, if it is not, "UPC is not legal" is returned.

Cheers,

Jesper Tverskov,
http://www.xmlplease.com/xslt

Current Thread