<commit_before><?xml version="1.0" encoding="iso-8859-1"?>
<!--
 ! Master stylesheet
 !
 ! $Id$
 !-->
<xsl:stylesheet
 version="1.0"
 xmlns:exsl="http://exslt.org/common"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:func="http://exslt.org/functions"
 extension-element-prefixes="func"
>
  <xsl:output method="html" encoding="iso-8859-1" indent="no"/>
  <xsl:param name="__page"/>
  <xsl:param name="__frame"/>
  <xsl:param name="__state"/>
  <xsl:param name="__lang"/>
  <xsl:param name="__product"/>
  <xsl:param name="__sess"/>
  <xsl:param name="__query"/>

  <!--
   ! Function to display a serialized date object
   !
   ! @param  node-set date
   !-->
  <func:function name="func:datetime">
    <xsl:param name="date"/>
    
    <func:result>
      <xsl:value-of select="concat(
        exsl:node-set($date)/year, '-',
        format-number(exsl:node-set($date)/mon, '00'), '-',
        format-number(exsl:node-set($date)/mday, '00'), ' ',
        format-number(exsl:node-set($date)/hours, '00'), ':',
        format-number(exsl:node-set($date)/minutes, '00')
      )"/>
    </func:result>
  </func:function>

  <!--
   ! Function that trims characters off the beginning of a string
   !
   ! @param  string text
   ! @param  string chars
   !-->  
  <func:function name="func:ltrim">
    <xsl:param name="text"/>
    <xsl:param name="chars"/>
    
    <func:result>
      <xsl:choose>
        <xsl:when test="contains(substring($text, 1, 1), $chars)">
          <xsl:value-of select="func:ltrim(substring($text, 2, string-length($text)), $chars)"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$text"/>
        </xsl:otherwise>
      </xsl:choose>
    </func:result>
  </func:function>

  <!--
   ! Function to display a link to the type's api doc
   !
   ! @param  string type
   !-->
  <func:function name="func:typehref">
    <xsl:param name="type"/>

    <xsl:variable name="name" select="func:ltrim(substring-before(concat($type, '['), '['), '&amp;')"/>
    <func:result>
      <xsl:choose>
        <xsl:when test="contains($name, '.')">
          <xsl:value-of select="concat('/xml/', $__product, '.', $__lang, '/lookup?', $name)"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="concat('http://php3.de/types.', $name)"/>
        </xsl:otherwise>
      </xsl:choose>
    </func:result>
  </func:function>

  <!--
   ! Function that concatenates a text conditionally
   !
   ! @param  bool condition
   ! @param  string text
   !-->  
  <func:function name="func:concatif">
    <xsl:param name="condition"/>
    <xsl:param name="text"/>
    
    <func:result>
      <xsl:if test="condition">
        <xsl:value-of select="$text"/>
      </xsl:if>
    </func:result>
  </func:function>
  
  <!--
   ! Template for links with scheme "xp"
   !
   !-->
  <xsl:template match="reference/link[child::*[name() = 'scheme']/text() = 'xp']">
    <a href="/xml/{$__product}.{$__lang}/lookup?{host}"><xsl:value-of select="host"/></a>
  </xsl:template>

  <!--
   ! Template for links with scheme "rfc"
   !
   !-->
  <xsl:template match="reference/link[child::*[name() = 'scheme']/text() = 'rfc']">
    <a href="http://www.faqs.org/rfcs/rfc{host}.html#{fragment}" target="_blank">
      RFC <xsl:value-of select="host"/>
      <xsl:if test="string-length(fragment) != 0">
        Section <xsl:value-of select="fragment"/>
      </xsl:if>
    </a>
  </xsl:template>

  <!--
   ! Template for links with scheme "mailto"
   !
   !-->
  <xsl:template match="reference/link[child::*[name() = 'scheme']/text() = 'mailto']">
    <a href="mailto:{path}" target="_blank"><xsl:value-of select="path"/></a>
  </xsl:template>  

  <!--
   ! Template for links with scheme "php"
   !
   !-->  
  <xsl:template match="reference/link[child::*[name() = 'scheme']/text() = 'php']">
    <a href="http://php3.de/{host}" target="_blank"><xsl:value-of select="host"/></a>
  </xsl:template>

  <!--
   ! Template for links with scheme "http"
   !
   !-->
  <xsl:template match="reference/link[child::*[name() = 'scheme']/text() = 'http']"><commit_msg>- Prepend "PHP Manual" before links to the PHP manual<commit_after><?xml version="1.0" encoding="iso-8859-1"?>
<!--
 ! Master stylesheet
 !
 ! $Id$
 !-->
<xsl:stylesheet
 version="1.0"
 xmlns:exsl="http://exslt.org/common"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:func="http://exslt.org/functions"
 extension-element-prefixes="func"
>
  <xsl:output method="html" encoding="iso-8859-1" indent="no"/>
  <xsl:param name="__page"/>
  <xsl:param name="__frame"/>
  <xsl:param name="__state"/>
  <xsl:param name="__lang"/>
  <xsl:param name="__product"/>
  <xsl:param name="__sess"/>
  <xsl:param name="__query"/>

  <!--
   ! Function to display a serialized date object
   !
   ! @param  node-set date
   !-->
  <func:function name="func:datetime">
    <xsl:param name="date"/>
    
    <func:result>
      <xsl:value-of select="concat(
        exsl:node-set($date)/year, '-',
        format-number(exsl:node-set($date)/mon, '00'), '-',
        format-number(exsl:node-set($date)/mday, '00'), ' ',
        format-number(exsl:node-set($date)/hours, '00'), ':',
        format-number(exsl:node-set($date)/minutes, '00')
      )"/>
    </func:result>
  </func:function>

  <!--
   ! Function that trims characters off the beginning of a string
   !
   ! @param  string text
   ! @param  string chars
   !-->  
  <func:function name="func:ltrim">
    <xsl:param name="text"/>
    <xsl:param name="chars"/>
    
    <func:result>
      <xsl:choose>
        <xsl:when test="contains(substring($text, 1, 1), $chars)">
          <xsl:value-of select="func:ltrim(substring($text, 2, string-length($text)), $chars)"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$text"/>
        </xsl:otherwise>
      </xsl:choose>
    </func:result>
  </func:function>

  <!--
   ! Function to display a link to the type's api doc
   !
   ! @param  string type
   !-->
  <func:function name="func:typehref">
    <xsl:param name="type"/>

    <xsl:variable name="name" select="func:ltrim(substring-before(concat($type, '['), '['), '&amp;')"/>
    <func:result>
      <xsl:choose>
        <xsl:when test="contains($name, '.')">
          <xsl:value-of select="concat('/xml/', $__product, '.', $__lang, '/lookup?', $name)"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="concat('http://php3.de/types.', $name)"/>
        </xsl:otherwise>
      </xsl:choose>
    </func:result>
  </func:function>

  <!--
   ! Function that concatenates a text conditionally
   !
   ! @param  bool condition
   ! @param  string text
   !-->  
  <func:function name="func:concatif">
    <xsl:param name="condition"/>
    <xsl:param name="text"/>
    
    <func:result>
      <xsl:if test="condition">
        <xsl:value-of select="$text"/>
      </xsl:if>
    </func:result>
  </func:function>
  
  <!--
   ! Template for links with scheme "xp"
   !
   !-->
  <xsl:template match="reference/link[child::*[name() = 'scheme']/text() = 'xp']">
    <a href="/xml/{$__product}.{$__lang}/lookup?{host}"><xsl:value-of select="host"/></a>
  </xsl:template>

  <!--
   ! Template for links with scheme "rfc"
   !
   !-->
  <xsl:template match="reference/link[child::*[name() = 'scheme']/text() = 'rfc']">
    <a href="http://www.faqs.org/rfcs/rfc{host}.html#{fragment}" target="_blank">
      RFC <xsl:value-of select="host"/>
      <xsl:if test="string-length(fragment) != 0">
        Section <xsl:value-of select="fragment"/>
      </xsl:if>
    </a>
  </xsl:template>

  <!--
   ! Template for links with scheme "mailto"
   !
   !-->
  <xsl:template match="reference/link[child::*[name() = 'scheme']/text() = 'mailto']">
    <a href="mailto:{path}" target="_blank"><xsl:value-of select="path"/></a>
  </xsl:template>  

  <!--
   ! Template for links with scheme "php"
   !
   !-->  
  <xsl:template match="reference/link[child::*[name() = 'scheme']/text() = 'php']">
    <a href="http://php3.de/{host}" target="_blank">PHP Manual: <xsl:value-of select="host"/></a>
  </xsl:template>

  <!--
   ! Template for links with scheme "http"
   !
   !-->
  <xsl:template match="reference/link[child::*[name() = 'scheme']/text() = 'http']">
{'fraction_non_alphanumeric': 0.22195299248849043, 'fraction_numerical': 0.007996123091834261, 'mean_word_length': 3.0406265296133137, 'pattern_counts': {'":': 0, '<': 177, '<?xml version=': 2, '>': 177, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 12}, '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': '3061605', 'n_tokens_mistral': 3052, 'n_tokens_neox': 2856, 'n_words': 500}