sherly
asked on
Writing a xml output with special character to a table
In my xml node, i have a node value with special character < and >
<MarkText><ASSY MARK></MarkText>
I can retrieve it using alert(MarkTextNodes.item(i ).text);
However, when i try to write the output to a table :
strMarkObjectTable += "<table><tr><td>" + MarkTextNodes.item(i).text + "</tr></td></table>";
output.innerHTML=strMarkOb jectTable;
It is giving me an empty table. Please help!
<MarkText><ASSY MARK></MarkText>
I can retrieve it using alert(MarkTextNodes.item(i
However, when i try to write the output to a table :
strMarkObjectTable += "<table><tr><td>" + MarkTextNodes.item(i).text
output.innerHTML=strMarkOb
It is giving me an empty table. Please help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yes, you can replace & with &. But remember to add as the first replace, otherwise, the < and > does not work.
What I mean is the following:
var x = MarkTextNodes.item(i).text .replace(" &", "&").replace("<", "<").replace(">", ">")
What I mean is the following:
var x = MarkTextNodes.item(i).text
ASKER
Thank you so much!
ASKER