Hello,

Webprofiler generate an error when an xsl file is called when it contain a body tag

When the xsl is set like this

<!-- Root template -->
  <xsl:template match="/">
    <html>
      <head>
        <title>[title]</title>
        <script type="text/javascript" src="[jquery]"/>
        <script type="text/javascript" src="[jquery-tablesorter]"/>
        <script type="text/javascript" src="[parser-date-iso8601]"/>
        <script type="text/javascript" src="[xsl-js]"/>
        <link href="[xsl-css]" type="text/css" rel="stylesheet"/>
      </head>
      <body>
        <h1>[title]</h1>

        <xsl:choose>
          <xsl:when test="//sitemap:url">
            <xsl:call-template name="sitemapTable"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:call-template name="sitemapIndexTable"/>
          </xsl:otherwise>
        </xsl:choose>

        <div id="footer">
          <p>[generated-by]</p>
        </div>
      </body>
    </html>
  </xsl:template>

webprofiler add thoses invalids lines before `/body`

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'webprofiler_loader' -->
<!-- BEGIN OUTPUT from 'modules/contrib/devel/webprofiler/templates/Profiler/webprofiler_loader.html.twig' -->
<div id="webprofiler9f9439" class="sf-toolbar" style="display: none"></div>

<script>
    Webprofiler = (function () {
        "use strict";
         .....
         for (var n = 0; n < arr.length; n++) {
          eval(arr[n].innerHTML);
        }
        ....
    })();

    Webprofiler.load();
</script>

The bug can easy been reproduced by installing the module `simple_sitemap`

Comments

Anonymous’s picture

duGuillaume created an issue.