blob: ef437803c97a2e36b3f6371d22515142f213d3e6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
<html>
<script>
var xml = "<e/>";
var xsl = "<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"><xsl:decimal-format grouping-separator=\".\" /><xsl:template match=\"/\"><xsl:value-of select=\"format-number(0.1, '.#')\"/></xsl:template></xsl:stylesheet>";
var parser = new DOMParser();
var xmlDoc = parser.parseFromString(xml, "text/xml");
var xslDoc = parser.parseFromString(xsl, "text/xml");
xsltProcessor = new XSLTProcessor();
xsltProcessor.importStylesheet(xslDoc);
var result = xsltProcessor.transformToDocument(xmlDoc);
</script>
</html>
|