I have a variable in javascript which has XML data. When I try to print it, it prints only values of XML data and doesn't print XML tags.
I have this function:
function printxml(xmlData,requestTag) {
var myWindow=window.open('');
myWindow.document.write("<div id='hii'>+"xmlData+"<div>");
}
Where xmldata
contains:
<?xml version="1.0" encoding="UTF-8"?>
<book>
<author>Sindhu</author>
<BookName>BookName</BookName>
</book>
It prints only
SindhuBookName