Skip to content

Instantly share code, notes, and snippets.

@dpk dpk/format.xslt
Created Oct 29, 2016

Embed
What would you like to do?
<?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>