xsl-list
[Top] [All Lists]

Re: [xsl] XPath MOD 10 calculation

2007-05-25 02:19:35
On 5/25/07, Andrew Welch <andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com> 
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>