test_parameter.html 996 B

1234567891011121314151617181920212223242526272829303132
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <title>Test for setParameter/getParameter</title>
  5. <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  6. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  7. </head>
  8. <body>
  9. <p id="display"></p>
  10. <div id="content" style="display: none"></div>
  11. <pre id="test">
  12. <script>
  13. var processor = new XSLTProcessor();
  14. processor.setParameter(null, "test", "hello");
  15. is(processor.getParameter(null, "test"), "hello", "null namespace works");
  16. processor.setParameter("foo", "bar", "foobar");
  17. is(processor.getParameter("foo", "bar"), "foobar", "non-null namespace works");
  18. processor.setParameter(null, "test", 123);
  19. is(processor.getParameter(null, "test"), 123, "number value works");
  20. processor.removeParameter(null, "test");
  21. is(processor.getParameter(null, "test"), null, "removeParameter works");
  22. is(processor.getParameter(null, "not-here"), null, "nonexistant parameter");
  23. </script>
  24. </pre>
  25. </body>
  26. </html>