Question: In the XSL file below I put a part of the code
(concerning the euro-sign) in comment. If I remove the
comment then it doesn't work anymore. How can this be solved?
I run Test.html with Internet Explorer on Window-XP.
Below I give all the files I'm using.
Look at following code:
File: Test.html
<html>
<head>
<script language="javascript" src="z_transform.js"></script>
</head>
<body>
<script language="javascript">
myXml = "test.xml";
myXsl = "test.xsl";
transformXsl();
</script>
</body>
</html>
File: Test.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<test amount="20.4">
</test>
File: Test.xsl
<?xml version="1.0"?>
<!--
<!DOCTYPE xsl:stylesheet
[
<!ENTITY euro "€">
]>
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform">
<xsl:output method="html"/>
<xsl:template match="/">
Amount = <xsl:value-of select="/test/@amount"/>
<!-- € -->
</xsl:template>
</xsl:stylesheet>
File: z_transform.js
function transformXsl()
{
var rSourceDoc,rStyleDoc;
rSourceDoc = new ActiveXObject("microsoft.xmldom");
rSourceDoc.async="false";
rSourceDoc.load(myXml);
rStyleDoc = new ActiveXObject("microsoft.xmldom");
rStyleDoc.async="false";
rStyleDoc.load(myXsl);
document.write(rSourceDoc.transformNode(rStyleDoc) );
}