Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/xslt/tests/mochitest/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 2 kB image not shown  

Quelle  test_sorting_invalid_lang.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/dom/xslt/tests/mochitest/test_sorting_invalid_lang.html


<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1734679
-->

<head>
  <title>Test sorting with invalid lang</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1734679">Mozilla Bug 1734679</a>
<p id="display"></p>
<div id="content" style="display: none">

</div>
<pre id="test">
<script class="testbody" type="text/javascript">

/**
 * Test for Bug 1734679. Invalid language tags should not throw an error, and should
 * fall back to the app's locale.
 * */

var xmldoc, xsltdoc;

xmldoc = new DOMParser().parseFromString('\n\
  <?xml-stylesheet type="text/xsl" href="sort-lang.xsl" ?>\n\
  <list>\n\
    <entry>\n\
      <technology>CSS</technology>\n\
      <term>text-direction</term>\n\
    </entry>\n\
    <entry>\n\
      <technology>JavaScript</technology>\n\
      <term>Array.prototype.sort</term>\n\
    </entry>\n\
  </list>\n\
  ', "text/xml");

xsltdoc = new DOMParser().parseFromString('\n\
  <xsl:stylesheet version="1.0"\n\
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\n\
    <xsl:template match="/">\n\
      <html>\n\
      <body>\n\
        <table border="1">\n\
          <tr bgcolor="#9acd32">\n\
            <th>Technology</th>\n\
            <th>Term</th>\n\
          </tr>\n\
          <xsl:for-each select="list/entry">\n\
          <xsl:sort select="term" lang="$invalidLanguageTag"/>\n\
          <tr>\n\
            <td><xsl:value-of select="technology"/></td>\n\
            <td><xsl:value-of select="term"/></td>\n\
          </tr>\n\
          </xsl:for-each>\n\
        </table>\n\
      </body>\n\
      </html>\n\
    </xsl:template>\n\
  \n\
  </xsl:stylesheet>\n\
  ', "text/xml");

var processor = new XSLTProcessor;
processor.importStylesheet(xsltdoc);

try
{
  var result = processor.transformToDocument(xmldoc);
}
catch (e)
{
  ok(false, "There was an error.");
}
ok(result && result instanceof Document, "XSLT transform should have created a document");
</script>
</pre>
</body>
</html>

Messung V0.5
C=98 H=97 G=97

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.