I want to convert an xml element like this:
B0013FRNKG
to string in java
follow this to print,append data from xml data stored as string inside javscript
txt=""+""+
"athor name "+
"title "+
"path "+
""+
" "+
""+
"athor name "+
"title "+
"path "+
""+
" "+
""+
"athor name "+
"title "+
"path "+
""+
" "+
"";
if (window.DOMParser)
{
parser=new DOMParser();
xmlDoc=parser.parseFromString(txt,"text/xml");
}
else // Internet Explorer
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.loadXML(txt);
}
x=xmlDoc.getElementsByTagName("paper");
for (var i = 0; i < x.length; i++) {
var athor =x[i].childNodes[0].firstChild.nodeValue;
var title = x[i].childNodes[1].firstChild.nodeValue;
var path = x[i].childNodes[2].firstChild.nodeValue;
var tack =x[i].childNodes[3].firstChild.nodeValue;
//do something with these values...
//each iteration gives one paper details
var xml=document.getElementById("element_id");//
var li = document.createElement("br");// create a new
newlink = document.createElement('A'); // creating an element
newlink.innerHTML = athor;// adding athor value here
newlink.setAttribute('href', path);//
newlink.appendChild(li);// athor
document.getElementById("element_id").appendChild(newlink);//finaly it becomes
}