View Single Post
  #6 (permalink)  
Old June 7th, 2018, 08:44 AM
Flamengo Flamengo is offline
Registered User
Points: 15, Level: 1
Points: 15, Level: 1 Points: 15, Level: 1 Points: 15, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2018
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Solved via xslt:

<xsl:variable name="Luhn13Digits" select="translate(concat('0',substring(.,19,13 )),'.','')"/>
<xsl:variable name="restDigits" select="translate(concat('0',substring(.,32,13 )),'.','')"/>
<xsl:variable name="PairNumbers"
select="(((substring($Luhn13Digits, 2, 1)) + (substring($Luhn13Digits,4,1)) +
(substring($Luhn13Digits, 6, 1)) + (substring($Luhn13Digits, 8,1)) +
(substring($Luhn13Digits, 10, 1)) + (substring($Luhn13Digits, 12,1))))"/>
<xsl:variable name="Ludhpos13">
<xsl:choose>
<xsl:when test="substring($Luhn13Digits, 13, 1)*2 &gt; 9">
<xsl:value-of select="substring($Luhn13Digits, 13, 1)*2-9"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring($Luhn13Digits, 13, 1)*2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="Ludhpos11">
<xsl:choose>
<xsl:when test="substring($Luhn13Digits, 11, 1)*2 &gt; 9">
<xsl:value-of select="substring($Luhn13Digits, 11, 1)*2-9"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring($Luhn13Digits, 11, 1)*2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="Ludhpos9">
<xsl:choose>
<xsl:when test="substring($Luhn13Digits, 9, 1)*2 &gt; 9">
<xsl:value-of select="substring($Luhn13Digits, 9, 1)*2-9"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring($Luhn13Digits, 9, 1)*2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="Ludhpos7">
<xsl:choose>
<xsl:when test="substring($Luhn13Digits, 7, 1)*2 &gt; 9">
<xsl:value-of select="substring($Luhn13Digits, 7, 1)*2-9"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring($Luhn13Digits, 7, 1)*2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="Ludhpos5">
<xsl:choose>
<xsl:when test="substring($Luhn13Digits, 5, 1)*2 &gt; 9">
<xsl:value-of select="substring($Luhn13Digits, 5, 1)*2-9"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring($Luhn13Digits, 5, 1)*2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="Ludhpos3">
<xsl:choose>
<xsl:when test="substring($Luhn13Digits, 3, 1)*2 &gt; 9">
<xsl:value-of select="substring($Luhn13Digits, 3, 1)*2-9"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring($Luhn13Digits, 3, 1)*2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="Ludhpos1">
<xsl:choose>
<xsl:when test="substring($Luhn13Digits, 1, 1)*2 &gt; 9">
<xsl:value-of select="substring($Luhn13Digits, 1, 1)*2-9"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring($Luhn13Digits, 1, 1)*2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="OddNumbers" select="$Ludhpos1+$Ludhpos3+$Ludhpos5+$Ludhpos7+$L udhpos9+$Ludhpos11+$Ludhpos13"/>
<xsl:variable name="LuhnMod10" select="$PairNumbers+$OddNumbers"/>

The rest..

Regards,
Reply With Quote