Test Page


</p> <h1> HTML Javascript page </h1> <p>



Employees


function displayXml() {
document.getElementById(’empDetails’).innerHTML = xmlString;
};

        function htmlEntities(str) {
                var htmlString = String(str).replace(/&/g, '&amp;').replace(//g, '&gt;').replace(/"/g, '&quot;');
                return htmlString;
        }

        function displayXml() {
                    // Normal display of xml
                    document.getElementById('empDetails').innerHTML = xmlString;
                    alert("Normal display: \n" + xmlString);

                    // HTML conversion only
                    var htmlString = htmlEntities(xmlString);
                    document.getElementById('empDetails').innerHTML = htmlString;
                    alert("HTML formatted display: \n" + htmlString);

                    // Using vkbeautify
                    var beautifyHtmlString = vkbeautify.xml(xmlString);
                    document.getElementById('empDetails').innerHTML = beautifyHtmlString;
                    alert("VKbeautify display: \n" + beautifyHtmlString);
                };
    </script>
</body>