<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!--  File:       format-xspec-report-folding.xsl                          -->
<!--  Author:     <NAME>                                            -->
<!--  Tags:                                                                -->
<!--    Copyright (c) 2008, 2010 <NAME> (see end of file.)          -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->


<xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:x="http://www.jenitennison.com/xslt/xspec"
                xmlns:test="http://www.jenitennison.com/xslt/unit-test"
                exclude-result-prefixes="x xs test"
                xmlns:pkg="http://expath.org/ns/pkg"
                xmlns="http://www.w3.org/1999/xhtml">

<xsl:import href="format-xspec-report.xsl" />

<pkg:import-uri>http://www.jenitennison.com/xslt/xspec/format-xspec-report-folding.xsl</pkg:import-uri>

<xsl:template name="x:html-head-callback">
  <script language="javascript" type="text/javascript">
function toggle(scenarioID) {
  table = document.getElementById("t-"+scenarioID);
  icon = document.getElementById("icon-"+scenarioID)
  // need to:
  //   switch table.style.display between 'none' and 'block'
  //   switch between collapse and expand icons

   if (table.style.display == "none") {
    // This try/catch is to handle IE 7.  It doesn't support table.style.display = "table"
    try {
      table.style.display = "table";
    } catch(err) {
      table.style.display = "block";
    }
    icon.src = "<xsl:value-of select="resolve-uri('graphics/3angle-down.gif', static-base-uri())"/>" ;
    icon.alt = "collapse" ;
    icon.title = "collapse" ;
  }
  else {
    table.style.display = "none";
    icon.src = "<xsl:value-of select="resolve-uri('graphics/3angle-right.gif', static-base-uri())"/>" ;
    icon.alt = "expand" ;
    icon.title = "expand" ;
  };

  return;
}
</script>
</xsl:template>

<xsl:template name="x:format-top-level-scenario">
  <xsl:variable name="pending" as="xs:boolean"
    select="exists(@pending)" />
  <xsl:variable name="any-failure" as="xs:boolean"
    select="exists(x:test[@successful = 'false'])" />
  <xsl:variable name="any-descendant-failure" as="xs:boolean"
    select="exists(.//x:test[@successful = 'false'])" />
  <div id="{generate-id()}">
    <h2 id="h-{generate-id()}"
      class="{if ($pending) then 'pending' else if ($any-failure) then 'failed' else 'successful'}">
      <a href="javascript:toggle('{generate-id()}')">
        <img src="{resolve-uri(concat('graphics/', if ($any-descendant-failure) then '3angle-down.gif' else '3angle-right.gif'), static-base-uri())}"
          alt="{if ($any-descendant-failure) then 'collapse' else 'expand'}" id="icon-{generate-id()}"/>
      </a>
      <xsl:copy-of select="x:pending-callback(@pending)"/>
      <xsl:apply-templates select="x:label" mode="x:html-report" />
      <span class="scenario-totals"><commit_msg>Fix image path in format-xspec-report-folding.xsl (#370)<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!--  File:       format-xspec-report-folding.xsl                          -->
<!--  Author:     <NAME>                                            -->
<!--  Tags:                                                                -->
<!--    Copyright (c) 2008, 2010 <NAME> (see end of file.)          -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->


<xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:x="http://www.jenitennison.com/xslt/xspec"
                xmlns:test="http://www.jenitennison.com/xslt/unit-test"
                exclude-result-prefixes="x xs test"
                xmlns:pkg="http://expath.org/ns/pkg"
                xmlns="http://www.w3.org/1999/xhtml">

<xsl:import href="format-xspec-report.xsl" />

<pkg:import-uri>http://www.jenitennison.com/xslt/xspec/format-xspec-report-folding.xsl</pkg:import-uri>

<xsl:template name="x:html-head-callback">
  <script language="javascript" type="text/javascript">
function toggle(scenarioID) {
  table = document.getElementById("t-"+scenarioID);
  icon = document.getElementById("icon-"+scenarioID)
  // need to:
  //   switch table.style.display between 'none' and 'block'
  //   switch between collapse and expand icons

   if (table.style.display == "none") {
    // This try/catch is to handle IE 7.  It doesn't support table.style.display = "table"
    try {
      table.style.display = "table";
    } catch(err) {
      table.style.display = "block";
    }
    icon.src = "<xsl:value-of select="resolve-uri('../../graphics/3angle-down.gif', static-base-uri())"/>" ;
    icon.alt = "collapse" ;
    icon.title = "collapse" ;
  }
  else {
    table.style.display = "none";
    icon.src = "<xsl:value-of select="resolve-uri('../../graphics/3angle-right.gif', static-base-uri())"/>" ;
    icon.alt = "expand" ;
    icon.title = "expand" ;
  };

  return;
}
</script>
</xsl:template>

<xsl:template name="x:format-top-level-scenario">
  <xsl:variable name="pending" as="xs:boolean"
    select="exists(@pending)" />
  <xsl:variable name="any-failure" as="xs:boolean"
    select="exists(x:test[@successful = 'false'])" />
  <xsl:variable name="any-descendant-failure" as="xs:boolean"
    select="exists(.//x:test[@successful = 'false'])" />
  <div id="{generate-id()}">
    <h2 id="h-{generate-id()}"
      class="{if ($pending) then 'pending' else if ($any-failure) then 'failed' else 'successful'}">
      <a href="javascript:toggle('{generate-id()}')">
        <img src="{resolve-uri(concat('../../graphics/', if ($any-descendant-failure) then '3angle-down.gif' else '3angle-right.gif'), static-base-uri())}"
          alt="{if ($any-descendant-failure) then 'collapse' else 'expand'}" id="icon-{generate-id()}"/>
      </a>
      <xsl:copy-of select="x:pending-callback(@pending)"/>
      <xsl:apply-templates select="x:label" mode="x:html-report" />
      <span class="scenario-totals">
{'fraction_non_alphanumeric': 0.2225903139296419, 'fraction_numerical': 0.011200504811484461, 'mean_word_length': 2.4758771929824563, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 2, '>': 65, 'https://': 0, 'lorem ipsum': 0, 'www.': 12, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7382040', 'n_tokens_mistral': 2140, 'n_tokens_neox': 2022, 'n_words': 316}