<commit_before><xsl:stylesheet version="3.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:axsl="http://www.w3.org/1999/XSL/Transform/alias"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                xmlns:map="http://www.w3.org/2005/xpath-functions/map"
                xmlns:array="http://www.w3.org/2005/xpath-functions/array"
                exclude-result-prefixes="axsl map array">

  <xsl:import href="utils.xsl"/>

  <xsl:namespace-alias stylesheet-prefix="axsl" result-prefix="xsl"/>

  <xsl:output indent="yes"/>

  <xsl:variable name="style" select=". => map:get('style')" as="map(*)"/>

  <xsl:template match=".[. instance of map(*)]">
    <axsl:stylesheet version="2.0">
      <xsl:call-template name="generate-namespace-node"/>
      <axsl:template name="getChapterPrefix">
        <axsl:variable as="element()*" name="topicref" select="key('map-id', ancestor-or-self::*[contains(@class, ' topic/topic ')][1]/@id)" />
        <axsl:variable as="element()*" name="chapter" select="$topicref/ancestor-or-self::*[contains(@class, ' map/topicref ')]
                                                                                    [parent::opentopic:map or
                                                                                     parent::*[contains(@class, ' bookmap/part ')] or
                                                                                     parent::*[contains(@class, ' bookmap/appendices ')]][1]" />
        <axsl:variable name="number" as="node()*">
          <axsl:apply-templates select="$chapter[1]" mode="topicTitleNumber"/>
        </axsl:variable>
        <axsl:if test="exists($number)">
          <axsl:copy-of select="$number"/>
          <axsl:text>–</axsl:text>
        </axsl:if>
      </axsl:template>
      <xsl:if test="exists($style ?topic ?title-numbering) and $style ?topic ?title-numbering">
        <axsl:template name="insertChapterFirstpageStaticContent">
          <axsl:param name="type"/>
          <fo:block>
            <axsl:attribute name="id">
              <axsl:call-template name="generate-toc-id"/>
            </axsl:attribute>
            <axsl:choose>
              <axsl:when test="$type = 'chapter'">
                <fo:block axsl:use-attribute-sets="__chapter__frontmatter__name__container">
                  <axsl:call-template name="getVariable">
                    <axsl:with-param name="id" select="'Chapter with number'"/>
                    <axsl:with-param name="params" as="element()*">
                      <number>
                        <!--fo:block axsl:use-attribute-sets="__chapter__frontmatter__number__container">
                            <axsl:apply-templates select="key('map-id', @id)[1]" mode="topicTitleNumber"/>
                        </fo:block-->
                      </number>
                    </axsl:with-param>
                  </axsl:call-template>
                </fo:block>
              </axsl:when>
              <axsl:when test="$type = 'appendix'">
                <fo:block axsl:use-attribute-sets="__chapter__frontmatter__name__container">
                  <axsl:call-template name="getVariable">
                    <axsl:with-param name="id" select="'Appendix with number'"/>
                    <axsl:with-param name="params" as="element()*">
                      <number>
                        <!--fo:block axsl:use-attribute-sets="__chapter__frontmatter__number__container">
                            <axsl:apply-templates select="key('map-id', @id)[1]" mode="topicTitleNumber"/>
                        </fo:block-->
                      </number>
                    </axsl:with-param>
                  </axsl:call-template>
                </fo:block>
              </axsl:when>
              <axsl:when test="$type = 'appendices'">
                <fo:block axsl:use-attribute-sets="__chapter__frontmatter__name__container">
                  <axsl:call-template name="getVariable">
                    <axsl:with-param name="id" select="'Appendix with number'"/>
                    <axsl:with-param name="params" as="element()*">
                      <number>
                        <fo:block axsl:use-attribute-sets="__chapter__frontmatter__number__container">
                          <axsl:text>&#xA0;</axsl:text>
                        </fo:block>
                      </number>
                    </axsl:with-param>
                  </axsl:call-template>
                </fo:block>
              </axsl:when>
              <axsl:when test="$type = 'part'">
                <fo:block axsl:use-attribute-sets="__chapter__frontmatter__name__container">
                  <axsl:call-template name="getVariable">
                    <axsl:with-param name="id" select="'Part with number'"/>
                    <axsl:with-param name="params" as="element()*">
                      <number>
                        <fo:block axsl:use-attribute-sets="__chapter__frontmatter__number__container">
                          <axsl:apply-templates select="key('map-id', @id)[1]" mode="topicTitleNumber"/>
                        </fo:block>
                      </number>
                    </axsl:with-param>
                  </axsl:call-template>
                </fo:block>
              </axsl:when>
              <axsl:when test="$type = 'preface'">
                <fo:block axsl:use-attribute-sets="__chapter__frontmatter__name__container">
                  <axsl:call-template name="getVariable">
                    <axsl:with-param name="id" select="'Preface title'"/>
                  </axsl:call-template>
                </fo:block>
              </axsl:when>
              <axsl:when test="$type = 'notices'">
                <fo:block axsl:use-attribute-sets="__chapter__frontmatter__name__container">
                  <axsl:call-template name="getVariable">
                    <axsl:with-param name="id" select="'Notices title'"/>
                  </axsl:call-template>
                </fo:block>
              </axsl:when>
            </axsl:choose>
          </fo:block>
        </axsl:template>
      </xsl:if>
      <xsl:if test=". ?page_number = 'chapter-page'">
        <axsl:template name="startPageNumbering">
          <axsl:variable name="topicType" as="xs:string">
            <axsl:call-template name="determineTopicType"/>
          </axsl:variable>
          <axsl:variable name="topicref" select="key('map-id', ancestor-or-self::*[contains(@class, ' topic/topic ')][1]/@id)"/>
          <axsl:for-each select="$topicref[1]">
            <axsl:choose>
              <axsl:when test="$topicType = 'topicChapter'">
                <axsl:attribute name="initial-page-number">1</axsl:attribute>
                <fo:folio-prefix>
                  <axsl:number format="1" count="*[contains(@class, ' bookmap/chapter ')]"/>
                  <axsl:text>&#x2013;</axsl:text>
                </fo:folio-prefix>
              </axsl:when>
              <axsl:when test="$topicType = ('topicAppendix', 'topicAppendices')">
                <axsl:attribute name="initial-page-number">1</axsl:attribute>
                <fo:folio-prefix>
                  <axsl:number format="A" count="*[contains(@class, ' bookmap/appendix ')]"/>
                  <axsl:text>&#x2013;</axsl:text>
                </fo:folio-prefix>
              </axsl:when>
            </axsl:choose>
          </axsl:for-each>
          <!--xsl:comment>topicType: <axsl:value-of select="$topicType"/></axsl:comment-->
        </axsl:template>
      </xsl:if>
      <xsl:if test=". ?cover_image_topic">
        <axsl:template match="*[contains(@class, ' topic/topic ')][@outputclass = '{. ?cover_image_topic}']" priority="1000"/>
      </xsl:if>
    </axsl:stylesheet>
  </xsl:template>

  <xsl:template match=".[. instance of map(*)]" mode="attr">
    <axsl:stylesheet version="2.0">
      <xsl:call-template name="generate-namespace-node"/>
      <axsl:variable name="e:root-id" select="'root'" as="xs:string"/>
      <!-- force page count -->
      <xsl:if test="exists(. ?force_page_count)">
        <axsl:attribute-set name="__force__page__count">
          <axsl:attribute name="force-page-count">
            <xsl:value-of select=". ?force_page_count"/>
          </axsl:attribute>
        </axsl:attribute-set>
      </xsl:if>
      <!-- font family -->
      <axsl:attribute-set name="__fo__root">
        <xsl:call-template name="attribute-set">
          <xsl:with-param name="style" select="$style('body')"/>
          <xsl:with-param name="properties" select="('font-family', 'color', 'text-align')"/>
        </xsl:call-template>
        <axsl:attribute name="id" select="$e:root-id"/>
      </axsl:attribute-set>
      <!-- link -->
      <axsl:attribute-set name="common.link">
        <xsl:call-template name="attribute-set">
          <xsl:with-param name="style" select="$style('link')"/>
        </xsl:call-template>
      </axsl:attribute-set>
      <!-- normal block -->
      <axsl:attribute-set name="common.block">
        <xsl:call-template name="attribute-set">
          <xsl:with-param name="style" select="$style('body')"/>
          <xsl:with-param name="properties" select="$allProperties[. ne 'start-indent']"/>
        </xsl:call-template>
      </axsl:attribute-set>
    </axsl:stylesheet>
  </xsl:template>

</xsl:stylesheet><commit_msg>Disable page_number for FOP<commit_after><xsl:stylesheet version="3.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:axsl="http://www.w3.org/1999/XSL/Transform/alias"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                xmlns:map="http://www.w3.org/2005/xpath-functions/map"
                xmlns:array="http://www.w3.org/2005/xpath-functions/array"
                exclude-result-prefixes="axsl map array">

  <xsl:import href="utils.xsl"/>

  <xsl:namespace-alias stylesheet-prefix="axsl" result-prefix="xsl"/>

  <xsl:output indent="yes"/>

  <xsl:variable name="style" select=". => map:get('style')" as="map(*)"/>

  <xsl:template match=".[. instance of map(*)]">
    <axsl:stylesheet version="2.0">
      <xsl:call-template name="generate-namespace-node"/>
      <axsl:template name="getChapterPrefix">
        <axsl:variable as="element()*" name="topicref" select="key('map-id', ancestor-or-self::*[contains(@class, ' topic/topic ')][1]/@id)" />
        <axsl:variable as="element()*" name="chapter" select="$topicref/ancestor-or-self::*[contains(@class, ' map/topicref ')]
                                                                                    [parent::opentopic:map or
                                                                                     parent::*[contains(@class, ' bookmap/part ')] or
                                                                                     parent::*[contains(@class, ' bookmap/appendices ')]][1]" />
        <axsl:variable name="number" as="node()*">
          <axsl:apply-templates select="$chapter[1]" mode="topicTitleNumber"/>
        </axsl:variable>
        <axsl:if test="exists($number)">
          <axsl:copy-of select="$number"/>
          <axsl:text>–</axsl:text>
        </axsl:if>
      </axsl:template>
      <xsl:if test="exists($style ?topic ?title-numbering) and $style ?topic ?title-numbering">
        <axsl:template name="insertChapterFirstpageStaticContent">
          <axsl:param name="type"/>
          <fo:block>
            <axsl:attribute name="id">
              <axsl:call-template name="generate-toc-id"/>
            </axsl:attribute>
            <axsl:choose>
              <axsl:when test="$type = 'chapter'">
                <fo:block axsl:use-attribute-sets="__chapter__frontmatter__name__container">
                  <axsl:call-template name="getVariable">
                    <axsl:with-param name="id" select="'Chapter with number'"/>
                    <axsl:with-param name="params" as="element()*">
                      <number>
                        <!--fo:block axsl:use-attribute-sets="__chapter__frontmatter__number__container">
                            <axsl:apply-templates select="key('map-id', @id)[1]" mode="topicTitleNumber"/>
                        </fo:block-->
                      </number>
                    </axsl:with-param>
                  </axsl:call-template>
                </fo:block>
              </axsl:when>
              <axsl:when test="$type = 'appendix'">
                <fo:block axsl:use-attribute-sets="__chapter__frontmatter__name__container">
                  <axsl:call-template name="getVariable">
                    <axsl:with-param name="id" select="'Appendix with number'"/>
                    <axsl:with-param name="params" as="element()*">
                      <number>
                        <!--fo:block axsl:use-attribute-sets="__chapter__frontmatter__number__container">
                            <axsl:apply-templates select="key('map-id', @id)[1]" mode="topicTitleNumber"/>
                        </fo:block-->
                      </number>
                    </axsl:with-param>
                  </axsl:call-template>
                </fo:block>
              </axsl:when>
              <axsl:when test="$type = 'appendices'">
                <fo:block axsl:use-attribute-sets="__chapter__frontmatter__name__container">
                  <axsl:call-template name="getVariable">
                    <axsl:with-param name="id" select="'Appendix with number'"/>
                    <axsl:with-param name="params" as="element()*">
                      <number>
                        <fo:block axsl:use-attribute-sets="__chapter__frontmatter__number__container">
                          <axsl:text>&#xA0;</axsl:text>
                        </fo:block>
                      </number>
                    </axsl:with-param>
                  </axsl:call-template>
                </fo:block>
              </axsl:when>
              <axsl:when test="$type = 'part'">
                <fo:block axsl:use-attribute-sets="__chapter__frontmatter__name__container">
                  <axsl:call-template name="getVariable">
                    <axsl:with-param name="id" select="'Part with number'"/>
                    <axsl:with-param name="params" as="element()*">
                      <number>
                        <fo:block axsl:use-attribute-sets="__chapter__frontmatter__number__container">
                          <axsl:apply-templates select="key('map-id', @id)[1]" mode="topicTitleNumber"/>
                        </fo:block>
                      </number>
                    </axsl:with-param>
                  </axsl:call-template>
                </fo:block>
              </axsl:when>
              <axsl:when test="$type = 'preface'">
                <fo:block axsl:use-attribute-sets="__chapter__frontmatter__name__container">
                  <axsl:call-template name="getVariable">
                    <axsl:with-param name="id" select="'Preface title'"/>
                  </axsl:call-template>
                </fo:block>
              </axsl:when>
              <axsl:when test="$type = 'notices'">
                <fo:block axsl:use-attribute-sets="__chapter__frontmatter__name__container">
                  <axsl:call-template name="getVariable">
                    <axsl:with-param name="id" select="'Notices title'"/>
                  </axsl:call-template>
                </fo:block>
              </axsl:when>
            </axsl:choose>
          </fo:block>
        </axsl:template>
      </xsl:if>
      <xsl:if test=". ?formatter != 'fop'">
        <xsl:if test=". ?page_number = 'chapter-page'">
          <axsl:template name="startPageNumbering">
            <axsl:variable name="topicType" as="xs:string">
              <axsl:call-template name="determineTopicType"/>
            </axsl:variable>
            <axsl:variable name="topicref" select="key('map-id', ancestor-or-self::*[contains(@class, ' topic/topic ')][1]/@id)"/>
            <axsl:for-each select="$topicref[1]">
              <axsl:choose>
                <axsl:when test="$topicType = 'topicChapter'">
                  <axsl:attribute name="initial-page-number">1</axsl:attribute>
                  <fo:folio-prefix>
                    <axsl:number format="1" count="*[contains(@class, ' bookmap/chapter ')]"/>
                    <axsl:text>&#x2013;</axsl:text>
                  </fo:folio-prefix>
                </axsl:when>
                <axsl:when test="$topicType = ('topicAppendix', 'topicAppendices')">
                  <axsl:attribute name="initial-page-number">1</axsl:attribute>
                  <fo:folio-prefix>
                    <axsl:number format="A" count="*[contains(@class, ' bookmap/appendix ')]"/>
                    <axsl:text>&#x2013;</axsl:text>
                  </fo:folio-prefix>
                </axsl:when>
              </axsl:choose>
            </axsl:for-each>
            <!--xsl:comment>topicType: <axsl:value-of select="$topicType"/></axsl:comment-->
          </axsl:template>
        </xsl:if>
      </xsl:if>
      <xsl:if test=". ?cover_image_topic">
        <axsl:template match="*[contains(@class, ' topic/topic ')][@outputclass = '{. ?cover_image_topic}']" priority="1000"/>
      </xsl:if>
    </axsl:stylesheet>
  </xsl:template>

  <xsl:template match=".[. instance of map(*)]" mode="attr">
    <axsl:stylesheet version="2.0">
      <xsl:call-template name="generate-namespace-node"/>
      <axsl:variable name="e:root-id" select="'root'" as="xs:string"/>
      <!-- force page count -->
      <xsl:if test="exists(. ?force_page_count)">
        <axsl:attribute-set name="__force__page__count">
          <axsl:attribute name="force-page-count">
            <xsl:value-of select=". ?force_page_count"/>
          </axsl:attribute>
        </axsl:attribute-set>
      </xsl:if>
      <!-- font family -->
      <axsl:attribute-set name="__fo__root">
        <xsl:call-template name="attribute-set">
          <xsl:with-param name="style" select="$style('body')"/>
          <xsl:with-param name="properties" select="('font-family', 'color', 'text-align')"/>
        </xsl:call-template>
        <axsl:attribute name="id" select="$e:root-id"/>
      </axsl:attribute-set>
      <!-- link -->
      <axsl:attribute-set name="common.link">
        <xsl:call-template name="attribute-set">
          <xsl:with-param name="style" select="$style('link')"/>
        </xsl:call-template>
      </axsl:attribute-set>
      <!-- normal block -->
      <axsl:attribute-set name="common.block">
        <xsl:call-template name="attribute-set">
          <xsl:with-param name="style" select="$style('body')"/>
          <xsl:with-param name="properties" select="$allProperties[. ne 'start-indent']"/>
        </xsl:call-template>
      </axsl:attribute-set>
    </axsl:stylesheet>
  </xsl:template>

</xsl:stylesheet>
{'fraction_non_alphanumeric': 0.16682534645086217, 'fraction_numerical': 0.005818258753834762, 'mean_word_length': 1.8594978826376285, 'pattern_counts': {'":': 0, '<': 359, '<?xml version=': 0, '>': 361, 'https://': 0, 'lorem ipsum': 0, 'www.': 10, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4812461', 'n_tokens_mistral': 5709, 'n_tokens_neox': 5289, 'n_words': 751}