<commit_before><?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
<!--
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.

You should have received a copy of the GNU Lesser General Public License
along with this program; see the file COPYING.LGPL.  If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:mal="http://www.gnome.org/~shaunm/mallard"
                version="1.0">

<!--!!==========================================================================
Mallard Links
-->


<!--@@==========================================================================
mal.cache.file
The location of the cache file
-->
<xsl:param name="mal.cache.file"/>
<xsl:variable name="mal.cache" select="document($mal.cache.file)"/>
<xsl:key name="mal.cache.key" match="mal:page | mal:section" use="@id"/>


<!--**==========================================================================
mal.link.content
Generates the content for a #{link} element
$link: The #{link} or other element creating the link
$xref: The #{xref} attribute of ${link}
$href: The #{href} attribute of ${link}
-->
<xsl:template name="mal.link.content">
  <xsl:param name="link" select="."/>
  <xsl:param name="xref" select="$link/@xref"/>
  <xsl:param name="href" select="$link/@href"/>
  <xsl:choose>
    <xsl:when test="contains($xref, '/')">
      <!--
      This is a link to another document, which we don't handle in these
      stylesheets.  Extensions such as library or yelp should override
      this template to provide this functionality.
      -->
      <xsl:choose>
        <xsl:when test="$href">
          <xsl:value-of select="$href"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$xref"/><commit_msg>[mal-link.xsl] Make mal.cache an xsl:param<commit_after><?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
<!--
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.

You should have received a copy of the GNU Lesser General Public License
along with this program; see the file COPYING.LGPL.  If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:mal="http://www.gnome.org/~shaunm/mallard"
                version="1.0">

<!--!!==========================================================================
Mallard Links
-->


<!--@@==========================================================================
mal.cache.file
The location of the cache file
-->
<xsl:param name="mal.cache.file"/>
<xsl:param name="mal.cache" select="document($mal.cache.file)/mal:cache"/>
<xsl:key name="mal.cache.key" match="mal:page | mal:section" use="@id"/>


<!--**==========================================================================
mal.link.content
Generates the content for a #{link} element
$link: The #{link} or other element creating the link
$xref: The #{xref} attribute of ${link}
$href: The #{href} attribute of ${link}
-->
<xsl:template name="mal.link.content">
  <xsl:param name="link" select="."/>
  <xsl:param name="xref" select="$link/@xref"/>
  <xsl:param name="href" select="$link/@href"/>
  <xsl:choose>
    <xsl:when test="contains($xref, '/')">
      <!--
      This is a link to another document, which we don't handle in these
      stylesheets.  Extensions such as library or yelp should override
      this template to provide this functionality.
      -->
      <xsl:choose>
        <xsl:when test="$href">
          <xsl:value-of select="$href"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$xref"/>
{'fraction_non_alphanumeric': 0.2251286449399657, 'fraction_numerical': 0.01072041166380789, 'mean_word_length': 3.9893048128342246, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 2, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7567624', 'n_tokens_mistral': 1368, 'n_tokens_neox': 1237, 'n_words': 459}