I have following StyleSheet information in a XSLT file located in my project directory, am reading this file and storing it inside a TextArea in HTML and then later i read the Textarea using javascript.
When i read the Text Area in IE9+ browsers using document.getElementByID("TestAreaID").value, it automatically removes the name spaces and hence am unable to Generate a PDF in IE9+ browsers. when i add the namespaces in debug mode then it is opening in IE9+ browsers.
<textarea id="TestAreaID>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:fox="http://xmlgraphics.apache.org/fop/extensions"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:java="http://xml.apache.org/xslt/java"
xmlns:xalan="http://xml.apache.org/xalan"
xmlns:barcode="http://barcode4j.krysalis.org/ns"
xmlns:pagematrix="http://phi.thc.com/pagematrix"
xmlns:math="xalan://java.lang.Math" extension-element-prefixes="math" version="1.1">
<xsl:output method="xml" omit-xml-declaration="no" indent="yes" version="1.0" doctype-system="http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd" doctype-public="-//W3C//DTD SVG 20000802//EN"/>
</textarea>
After reading the Text Area in javascript using document.getElementByID("TestAreaID").value, only below informations are returned
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes="math" version="1.1">
<xsl:output method="xml" omit-xml-declaration="no" indent="yes" version="1.0" doctype-system="http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd" doctype-public="-//W3C//DTD SVG 20000802//EN"/>
Am confused why it is not reading the TextArea value fully and omitting some namespaces, but it working fine in Chrome,FireFox nd IE8 browser.
Below is the HTML code
<textarea id="TestAreaID" name="TestAreaID_index_0" style="display:none">
$formInputData.getField("PrintControl").getValue()
</textarea>
getField() is a static method which reads and returns the xsl file contents,,This returns the xsl file contents properly, but when i read it in javascript namespaces are removed
This is what we have in javascript part
var xmlText = document.getElementById("TestAreaID").value;
xmlText = xmlText.replace(/~1/g, "~"); // This gets set back to ampersand later
xmlText = xmlText.replace(/~2/g, "<");
if (window.DOMParser)
{
parser=new DOMParser();
_xmlDoc=parser.parseFromString(xmlText,"text/xml");
}
else // Internet Explorer
{
_xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
_xmlDoc.async="false";
_xmlDoc.loadXML(xmlText);
}
document.getElementById("TestAreaID").value = xmlText;