<commit_before><?xml version="1.0"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:dir="http://apache.org/cocoon/directory/2.0"
  xmlns:yanel="http://www.wyona.org/yanel/resource/directory/1.0"
  >

  <xsl:output method="xhtml"/>

  <!-- NOTE: Must correspond with the mime-type delivered by the server. See src/java/org/wyona/yanel/impl/resources/DirectoryResource.java -->
  <!--
<xsl:output method="html"/>
-->

  <xsl:param name="yanel.path.name" select="'NAME_IS_NULL'"/>
  <xsl:param name="yanel.path" select="'PATH_IS_NULL'"/>
  <xsl:param name="yanel.back2context" select="'BACK2CONTEXT_IS_NULL'"/>
  <xsl:param name="yarep.back2realm" select="'BACK2REALM_IS_NULL'"/>
  <xsl:param name="yarep.parent" select="'YAREPPARENT_IS_NULL'"/>
  <xsl:param name="yanel.htdocs" select="'YANELHTDOCS_IS_NULL'"/>

  <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title>Collection: <xsl:value-of select="/dir:directory/@yanel:path"/>
        </title>
        <script src="{$yanel.htdocs}yanel-js/sorttable.js" type="text/javascript"/>
      </head>
      <body>
        <div>
          <p>
            <b>Yanel Path (with regard to realm):</b>&#160;<xsl:value-of select="/dir:directory/@yanel:path"/>
          </p>
          <p>
            <b>Collection Path:</b>&#160;<xsl:value-of
            select="/dir:directory/@dir:path"/> (<a
              href="?yanel.resource.viewid=source">XML view</a>)</p>
          <p>
            <table class="sortable">
              <thead>
                <tr>
                  <th>Type</th>
                  <th class="sorttable_alpha">Name</th>
                  <th>Lastmodified</th>
                  <th>Size</th>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td sorttable_customkey="1">Parent </td>
                  <td>
                    <a href="{$yarep.parent}" title="directory">..</a>
                  </td>
                  <td> - </td>
                  <td> - </td>
                </tr>
                <xsl:apply-templates select="/dir:directory/*"/>
              </tbody>
            </table>
          </p>
        </div>
      </body>
    </html>
  </xsl:template>

  <xsl:template match="dir:directory">
    <tr>
      <td sorttable_customkey="Collection">Collection </td>
      <td>
        <a href="{$yarep.back2realm}.{@path}/" title="directory">
          <xsl:value-of select="@name"/>
        </a>
      </td>
      <td> - </td>
      <td sorttable_customkey="0"> - </td>
    </tr>
  </xsl:template>

  <xsl:template match="dir:file">
    <tr>
      <td sorttable_customkey="Resource">Resource</td>
      <td>
        <a href="{$yarep.back2realm}.{@path}" title="file">
          <xsl:value-of select="@name"/>
        </a>
      </td>
      <td>
        <xsl:value-of select="@date"/>
      </td>
      <td sorttable_customkey="{@size}">
        <xsl:call-template name="humanbyte">
        <xsl:with-param name="bytes">
          <xsl:value-of select="@size"/>
        </xsl:with-param>
      </xsl:call-template>
      </td>
    </tr><commit_msg>adding class to easy distinct between the different table fields. (e.g. for further xsl transformation)<commit_after><?xml version="1.0"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:dir="http://apache.org/cocoon/directory/2.0"
  xmlns:yanel="http://www.wyona.org/yanel/resource/directory/1.0"
  >

  <xsl:output method="xhtml"/>

  <!-- NOTE: Must correspond with the mime-type delivered by the server. See src/java/org/wyona/yanel/impl/resources/DirectoryResource.java -->
  <!--
<xsl:output method="html"/>
-->

  <xsl:param name="yanel.path.name" select="'NAME_IS_NULL'"/>
  <xsl:param name="yanel.path" select="'PATH_IS_NULL'"/>
  <xsl:param name="yanel.back2context" select="'BACK2CONTEXT_IS_NULL'"/>
  <xsl:param name="yarep.back2realm" select="'BACK2REALM_IS_NULL'"/>
  <xsl:param name="yarep.parent" select="'YAREPPARENT_IS_NULL'"/>
  <xsl:param name="yanel.htdocs" select="'YANELHTDOCS_IS_NULL'"/>

  <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title>Collection: <xsl:value-of select="/dir:directory/@yanel:path"/>
        </title>
        <script src="{$yanel.htdocs}yanel-js/sorttable.js" type="text/javascript"/>
      </head>
      <body>
        <div>
          <p>
            <b>Yanel Path (with regard to realm):</b>&#160;<xsl:value-of select="/dir:directory/@yanel:path"/>
          </p>
          <p>
            <b>Collection Path:</b>&#160;<xsl:value-of
            select="/dir:directory/@dir:path"/> (<a
              href="?yanel.resource.viewid=source">XML view</a>)</p>
          <p>
            <table class="sortable">
              <thead>
                <tr>
                  <th>Type</th>
                  <th class="sorttable_alpha">Name</th>
                  <th>Lastmodified</th>
                  <th>Size</th>
                </tr>
              </thead>
              <tbody>
                <tr class="parent">
                  <td class="type" sorttable_customkey="1">Parent </td>
                  <td class="name">
                    <a href="{$yarep.parent}" title="directory">..</a>
                  </td>
                  <td class="lastmodifier"> - </td>
                  <td class="size"> - </td>
                </tr>
                <xsl:apply-templates select="/dir:directory/*"/>
              </tbody>
            </table>
          </p>
        </div>
      </body>
    </html>
  </xsl:template>

  <xsl:template match="dir:directory">
    <tr class="collection">
      <td class="type" sorttable_customkey="Collection">Collection </td>
      <td class="name">
        <a href="{$yarep.back2realm}.{@path}/" title="directory">
          <xsl:value-of select="@name"/>
        </a>
      </td>
      <td class="lastmodifier"> - </td>
      <td class="size" sorttable_customkey="0"> - </td>
    </tr>
  </xsl:template>

  <xsl:template match="dir:file">
    <tr class="file">
      <td class="type" sorttable_customkey="Resource">Resource</td>
      <td class="name">
        <a href="{$yarep.back2realm}.{@path}" title="file">
          <xsl:value-of select="@name"/>
        </a>
      </td>
      <td class="lastmodifier">
        <xsl:value-of select="@date"/>
      </td>
      <td class="size" sorttable_customkey="{@size}">
        <xsl:call-template name="humanbyte">
        <xsl:with-param name="bytes">
          <xsl:value-of select="@size"/>
        </xsl:with-param>
      </xsl:call-template>
      </td>
    </tr>
{'fraction_non_alphanumeric': 0.1938132238674681, 'fraction_numerical': 0.012314909837267263, 'mean_word_length': 2.1051433773327264, 'pattern_counts': {'":': 0, '<': 211, '<?xml version=': 2, '>': 211, 'https://': 0, 'lorem ipsum': 0, 'www.': 10, 'xml': 14}, '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': '516531', 'n_tokens_mistral': 2437, 'n_tokens_neox': 2259, 'n_words': 348}