Skip to content

Instantly share code, notes, and snippets.

@dpk
Created October 29, 2016 20:32
Show Gist options
  • Save dpk/71d036e8b9ab3d7a900d5e1616c37016 to your computer and use it in GitHub Desktop.
Save dpk/71d036e8b9ab3d7a900d5e1616c37016 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:isbn="tag:nonceword.org,2016:isbn">
<xsl:import href="util.xslt"/>
<xsl:import href="unformat.xslt"/>
<xsl:function name="isbn:format-13">
<xsl:param name="isbn"/>
<xsl:value-of select="string(isbn:format-13-internal($isbn))"/>
</xsl:function>
<xsl:function name="isbn:format-13-internal">
<xsl:param name="isbn"/>
<xsl:variable name="raw-isbn" select="isbn:unformat($isbn)"/>
<xsl:choose>
<xsl:when test="starts-with($raw-isbn, '97899901')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899902')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899903')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899904')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899905')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899906')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899908')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899909')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899910')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899911')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899912')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899913')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '3599999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3600000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '6049999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6050000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899914')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899915')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899916')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899917')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899918')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899919')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899920')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899921')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899922')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899923')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899924')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899925')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899926')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8700000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899927')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899928')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899929')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899930')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899931')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899932')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899933')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899934')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899935')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899936')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899937')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899938')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899939')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899940')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899941')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899942')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899943')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899944')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899945')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899946')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899947')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899948')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899949')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899950')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899951')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899952')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899953')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9400000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899954')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8799999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8800000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899955')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899956')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8599999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8600000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899957')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899958')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '9399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9400000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899959')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899960')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899961')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899962')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899963')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '9199999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9200000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899964')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899965')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '6299999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6300000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899966')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899967')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899968')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899969')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899970')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899971')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899972')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899973')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899974')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899975')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899976')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899977')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899978')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97899979')">
<xsl:variable name="next-section" select="substring($raw-isbn, 9)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="5"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789924')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '6499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789925')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '5499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5500000' &lt;= $next-section) and ($next-section &lt;= '7349999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7350000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789926')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789927')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789928')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789929')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '5499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5500000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789930')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '9399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9400000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789931')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789932')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789933')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789934')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789935')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789936')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789937')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789938')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789939')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789940')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789941')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789942')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9849999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9850000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789943')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '9749999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9750000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789944')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789945')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0099999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0100000' &lt;= $next-section) and ($next-section &lt;= '0799999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0800000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '5699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5700000' &lt;= $next-section) and ($next-section &lt;= '5799999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5800000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789946')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789947')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789948')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789949')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '7499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789950')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789951')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789952')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789953')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789954')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789955')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '9299999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9300000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789956')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789957')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '6499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6500000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8799999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8800000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789958')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0199999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0200000' &lt;= $next-section) and ($next-section &lt;= '0299999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0300000' &lt;= $next-section) and ($next-section &lt;= '0399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0400000' &lt;= $next-section) and ($next-section &lt;= '0899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0900000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '1899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1900000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789959')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9700000' &lt;= $next-section) and ($next-section &lt;= '9799999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9800000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789960')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789961')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789962')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '5499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5500000' &lt;= $next-section) and ($next-section &lt;= '5599999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5600000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789963')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '2499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2500000' &lt;= $next-section) and ($next-section &lt;= '2799999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2800000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '5499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5500000' &lt;= $next-section) and ($next-section &lt;= '7349999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7350000' &lt;= $next-section) and ($next-section &lt;= '7499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789964')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789965')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789966')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1500000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '7499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7500000' &lt;= $next-section) and ($next-section &lt;= '9599999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9600000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789967')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789968')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '9399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9400000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789970')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789971')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789972')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '2499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2500000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789973')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0599999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0600000' &lt;= $next-section) and ($next-section &lt;= '0899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0900000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '9699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9700000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789974')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '5499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5500000' &lt;= $next-section) and ($next-section &lt;= '7499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7500000' &lt;= $next-section) and ($next-section &lt;= '9099999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9100000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789975')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '4499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789976')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789977')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789978')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789979')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '6499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6500000' &lt;= $next-section) and ($next-section &lt;= '6599999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6600000' &lt;= $next-section) and ($next-section &lt;= '7599999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7600000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789980')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789981')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '1599999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1600000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789982')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789983')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789984')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789985')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789986')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9400000' &lt;= $next-section) and ($next-section &lt;= '9699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9700000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789987')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '8799999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8800000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789988')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '5499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5500000' &lt;= $next-section) and ($next-section &lt;= '7499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9789989')">
<xsl:variable name="next-section" select="substring($raw-isbn, 8)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="4"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978600')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978601')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978602')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0799999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0800000' &lt;= $next-section) and ($next-section &lt;= '0899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0900000' &lt;= $next-section) and ($next-section &lt;= '1099999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1100000' &lt;= $next-section) and ($next-section &lt;= '1199999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1200000' &lt;= $next-section) and ($next-section &lt;= '1399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1400000' &lt;= $next-section) and ($next-section &lt;= '1499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1500000' &lt;= $next-section) and ($next-section &lt;= '1699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1700000' &lt;= $next-section) and ($next-section &lt;= '1799999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1800000' &lt;= $next-section) and ($next-section &lt;= '1899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1900000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '6199999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6200000' &lt;= $next-section) and ($next-section &lt;= '6749999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6750000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '7499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7500000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978603')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0500000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978604')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9799999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9800000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978605')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0099999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0100000' &lt;= $next-section) and ($next-section &lt;= '0299999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0300000' &lt;= $next-section) and ($next-section &lt;= '0399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0400000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978606')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9099999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9100000' &lt;= $next-section) and ($next-section &lt;= '9199999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9200000' &lt;= $next-section) and ($next-section &lt;= '9749999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9750000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978607')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '7499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7500000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978608')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '4499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4500000' &lt;= $next-section) and ($next-section &lt;= '6499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6500000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978609')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978611')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978612')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '4499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4500000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978613')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978614')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978615')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978616')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978617')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978618')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978619')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1500000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978620')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978621')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978950')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978951')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '5499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5500000' &lt;= $next-section) and ($next-section &lt;= '8899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8900000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978952')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '6599999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6600000' &lt;= $next-section) and ($next-section &lt;= '6699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6700000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978953')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '1499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1500000' &lt;= $next-section) and ($next-section &lt;= '5099999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5100000' &lt;= $next-section) and ($next-section &lt;= '5499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5500000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978954')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2900000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9299999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9300000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978955')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '3799999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3800000' &lt;= $next-section) and ($next-section &lt;= '3899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3900000' &lt;= $next-section) and ($next-section &lt;= '4099999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4100000' &lt;= $next-section) and ($next-section &lt;= '4399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4400000' &lt;= $next-section) and ($next-section &lt;= '4499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4500000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '5499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5500000' &lt;= $next-section) and ($next-section &lt;= '7199999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7200000' &lt;= $next-section) and ($next-section &lt;= '7499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7500000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978956')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978957')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0299999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0300000' &lt;= $next-section) and ($next-section &lt;= '0499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0500000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '2099999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2100000' &lt;= $next-section) and ($next-section &lt;= '2799999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2800000' &lt;= $next-section) and ($next-section &lt;= '3099999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3100000' &lt;= $next-section) and ($next-section &lt;= '4399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4400000' &lt;= $next-section) and ($next-section &lt;= '8199999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8200000' &lt;= $next-section) and ($next-section &lt;= '9699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9700000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978958')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '5399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5400000' &lt;= $next-section) and ($next-section &lt;= '5599999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5600000' &lt;= $next-section) and ($next-section &lt;= '5699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5700000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978959')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978960')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '6599999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6600000' &lt;= $next-section) and ($next-section &lt;= '6899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6900000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '9299999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9300000' &lt;= $next-section) and ($next-section &lt;= '9399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9400000' &lt;= $next-section) and ($next-section &lt;= '9799999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9800000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978961')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978962')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8700000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978963')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978964')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1500000' &lt;= $next-section) and ($next-section &lt;= '2499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2500000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '5499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9700000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978965')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978966')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1299999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1300000' &lt;= $next-section) and ($next-section &lt;= '1399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1400000' &lt;= $next-section) and ($next-section &lt;= '1499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1500000' &lt;= $next-section) and ($next-section &lt;= '1699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1700000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '2789999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2790000' &lt;= $next-section) and ($next-section &lt;= '2899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2900000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9099999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9100000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9799999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9800000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978967')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0099999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0100000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '2499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2500000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9989999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9990000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978968')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0100000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978969')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '2299999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2300000' &lt;= $next-section) and ($next-section &lt;= '2399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2400000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '7499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978970')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0100000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9099999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9100000' &lt;= $next-section) and ($next-section &lt;= '9699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9700000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978971')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0159999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0160000' &lt;= $next-section) and ($next-section &lt;= '0199999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0200000' &lt;= $next-section) and ($next-section &lt;= '0299999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0300000' &lt;= $next-section) and ($next-section &lt;= '0599999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0600000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '9099999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9100000' &lt;= $next-section) and ($next-section &lt;= '9599999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9600000' &lt;= $next-section) and ($next-section &lt;= '9699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9700000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978972')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '5499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5500000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978973')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '1699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1700000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '5499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5500000' &lt;= $next-section) and ($next-section &lt;= '7599999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7600000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8900000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978974')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978975')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0199999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0200000' &lt;= $next-section) and ($next-section &lt;= '2499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2500000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '9199999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9200000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978976')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978977')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978978')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978979')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '1499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1500000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978980')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978981')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1700000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '3099999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3100000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978982')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9799999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9800000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978983')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0199999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0200000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '4499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4500000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978984')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978985')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978986')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1199999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1200000' &lt;= $next-section) and ($next-section &lt;= '5599999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5600000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978987')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '3599999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3600000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '4199999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4200000' &lt;= $next-section) and ($next-section &lt;= '4399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4400000' &lt;= $next-section) and ($next-section &lt;= '4499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4500000' &lt;= $next-section) and ($next-section &lt;= '4899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4900000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978988')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1199999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1200000' &lt;= $next-section) and ($next-section &lt;= '1499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1500000' &lt;= $next-section) and ($next-section &lt;= '1699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1700000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '7699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7700000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9700000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '978989')">
<xsl:variable name="next-section" select="substring($raw-isbn, 7)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '5499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5500000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="3"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97880')">
<xsl:variable name="next-section" select="substring($raw-isbn, 6)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97881')">
<xsl:variable name="next-section" select="substring($raw-isbn, 6)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97882')">
<xsl:variable name="next-section" select="substring($raw-isbn, 6)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '6899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6900000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97883')">
<xsl:variable name="next-section" select="substring($raw-isbn, 6)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97884')">
<xsl:variable name="next-section" select="substring($raw-isbn, 6)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1400000' &lt;= $next-section) and ($next-section &lt;= '1499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1500000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9199999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9200000' &lt;= $next-section) and ($next-section &lt;= '9239999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9240000' &lt;= $next-section) and ($next-section &lt;= '9299999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9300000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9700000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97885')">
<xsl:variable name="next-section" select="substring($raw-isbn, 6)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '5499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5500000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9249999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9250000' &lt;= $next-section) and ($next-section &lt;= '9449999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9450000' &lt;= $next-section) and ($next-section &lt;= '9599999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9600000' &lt;= $next-section) and ($next-section &lt;= '9799999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9800000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97886')">
<xsl:variable name="next-section" select="substring($raw-isbn, 6)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97887')">
<xsl:variable name="next-section" select="substring($raw-isbn, 6)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '6499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6500000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9700000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97888')">
<xsl:variable name="next-section" select="substring($raw-isbn, 6)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '3269999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3270000' &lt;= $next-section) and ($next-section &lt;= '3389999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3390000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9099999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9100000' &lt;= $next-section) and ($next-section &lt;= '9299999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9300000' &lt;= $next-section) and ($next-section &lt;= '9399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9400000' &lt;= $next-section) and ($next-section &lt;= '9479999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9480000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97889')">
<xsl:variable name="next-section" select="substring($raw-isbn, 6)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2500000' &lt;= $next-section) and ($next-section &lt;= '5499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5500000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9700000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97890')">
<xsl:variable name="next-section" select="substring($raw-isbn, 6)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9099999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9100000' &lt;= $next-section) and ($next-section &lt;= '9399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9400000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97891')">
<xsl:variable name="next-section" select="substring($raw-isbn, 6)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '6499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6500000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9700000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97892')">
<xsl:variable name="next-section" select="substring($raw-isbn, 6)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="1"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97893')">
<xsl:variable name="next-section" select="substring($raw-isbn, 6)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97894')">
<xsl:variable name="next-section" select="substring($raw-isbn, 6)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '5999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97910')">
<xsl:variable name="next-section" select="substring($raw-isbn, 6)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9759999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9760000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97911')">
<xsl:variable name="next-section" select="substring($raw-isbn, 6)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '2499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2500000' &lt;= $next-section) and ($next-section &lt;= '5499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5500000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '97912')">
<xsl:variable name="next-section" select="substring($raw-isbn, 6)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '2009999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2010000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="2"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9780')">
<xsl:variable name="next-section" select="substring($raw-isbn, 5)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '2279999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2280000' &lt;= $next-section) and ($next-section &lt;= '2289999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2290000' &lt;= $next-section) and ($next-section &lt;= '6479999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6480000' &lt;= $next-section) and ($next-section &lt;= '6489999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="7"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6490000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="7"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9781')">
<xsl:variable name="next-section" select="substring($raw-isbn, 5)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '5499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5500000' &lt;= $next-section) and ($next-section &lt;= '8697999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8698000' &lt;= $next-section) and ($next-section &lt;= '9989999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9990000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="7"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9782')">
<xsl:variable name="next-section" select="substring($raw-isbn, 5)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '3499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('3500000' &lt;= $next-section) and ($next-section &lt;= '3999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8400000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9199429')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9199430' &lt;= $next-section) and ($next-section &lt;= '9199689')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="7"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9199690' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="7"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9783')">
<xsl:variable name="next-section" select="substring($raw-isbn, 5)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0299999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0300000' &lt;= $next-section) and ($next-section &lt;= '0339999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0340000' &lt;= $next-section) and ($next-section &lt;= '0369999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0370000' &lt;= $next-section) and ($next-section &lt;= '0399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0400000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9539999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="7"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9540000' &lt;= $next-section) and ($next-section &lt;= '9699999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9700000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="7"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9949999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9950000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9784')">
<xsl:variable name="next-section" select="substring($raw-isbn, 5)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="7"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9785')">
<xsl:variable name="next-section" select="substring($raw-isbn, 5)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0049999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0050000' &lt;= $next-section) and ($next-section &lt;= '0099999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('0100000' &lt;= $next-section) and ($next-section &lt;= '1999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('2000000' &lt;= $next-section) and ($next-section &lt;= '4209999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4210000' &lt;= $next-section) and ($next-section &lt;= '4299999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4300000' &lt;= $next-section) and ($next-section &lt;= '4309999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4310000' &lt;= $next-section) and ($next-section &lt;= '4399999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4400000' &lt;= $next-section) and ($next-section &lt;= '4409999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4410000' &lt;= $next-section) and ($next-section &lt;= '4499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('4500000' &lt;= $next-section) and ($next-section &lt;= '6039999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6040000' &lt;= $next-section) and ($next-section &lt;= '6049999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="7"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('6050000' &lt;= $next-section) and ($next-section &lt;= '6999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('7000000' &lt;= $next-section) and ($next-section &lt;= '8499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8500000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9099999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9100000' &lt;= $next-section) and ($next-section &lt;= '9199999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9200000' &lt;= $next-section) and ($next-section &lt;= '9299999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9300000' &lt;= $next-section) and ($next-section &lt;= '9499999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9500000' &lt;= $next-section) and ($next-section &lt;= '9500999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="7"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9501000' &lt;= $next-section) and ($next-section &lt;= '9799999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9800000' &lt;= $next-section) and ($next-section &lt;= '9899999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9900000' &lt;= $next-section) and ($next-section &lt;= '9909999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="7"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9910000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($raw-isbn, '9787')">
<xsl:variable name="next-section" select="substring($raw-isbn, 5)"/>
<xsl:choose>
<xsl:when test="('0000000' &lt;= $next-section) and ($next-section &lt;= '0999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="2"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('1000000' &lt;= $next-section) and ($next-section &lt;= '4999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="3"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('5000000' &lt;= $next-section) and ($next-section &lt;= '7999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="4"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('8000000' &lt;= $next-section) and ($next-section &lt;= '8999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="5"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="('9000000' &lt;= $next-section) and ($next-section &lt;= '9999999')">
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="6"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="1"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="isbn:mask13">
<xsl:with-param name="isbn" select="$raw-isbn"/>
<xsl:with-param name="registration-group-length" select="0"/>
<xsl:with-param name="registrant-length" select="0"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:function>
<xsl:template name="isbn:mask13">
<xsl:param name="isbn"/>
<xsl:param name="registration-group-length"/>
<xsl:param name="registrant-length"/>
<wrap>
<xsl:value-of select="substring($isbn, 1, 3)"/>
<xsl:text>-</xsl:text>
<xsl:choose>
<xsl:when test="$registration-group-length = 0">
<xsl:value-of select="substring($isbn, 4, 9)"/>
<xsl:text>-</xsl:text>
</xsl:when>
<xsl:when test="$registrant-length = 0">
<xsl:value-of select="substring($isbn, 4, $registration-group-length)"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="substring($isbn, 4 + $registration-group-length, (13 - $registration-group-length - 4))"/>
<xsl:text>-</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring($isbn, 4, $registration-group-length)"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="substring($isbn, 4 + $registration-group-length, $registrant-length)"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="substring($isbn, 4 + $registration-group-length + $registrant-length, (13 - $registration-group-length - $registrant-length - 4))"/>
<xsl:text>-</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="substring($isbn, 13)"/>
</wrap>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment