[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XPath MOD 10 calculation

Subject: Re: XPath MOD 10 calculation
From: "Jesper Tverskov" <jesper@xxxxxxxxxxx>
Date: Fri, 25 May 2007 11:19:11 +0200
Re:  XPath MOD 10 calculation
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.