|
@@ -46,8 +46,24 @@
|
|
/**
|
|
/**
|
|
* 加载xml数据
|
|
* 加载xml数据
|
|
*/
|
|
*/
|
|
|
|
+ function htmlEscape(str){
|
|
|
|
+ var s = "";
|
|
|
|
+ if(str.length == 0) return "";
|
|
|
|
+ s = str.replace(/&/g,"&");
|
|
|
|
+ s = str.replace(/&/g,"&");
|
|
|
|
+ s = s.replace(/</g,"<");
|
|
|
|
+ s = s.replace(/>/g,">");
|
|
|
|
+ s = s.replace(/ /g," ");
|
|
|
|
+ s = s.replace(/'/g,"\'");
|
|
|
|
+ s = s.replace(/"/g,"\"");
|
|
|
|
+ s = s.replace(/<script.*?>.*?<\/script>/ig, '');
|
|
|
|
+ s = s.replace(/<script/gi, "<script ");
|
|
|
|
+ s = s.replace(/<iframe/gi, "<iframe ");
|
|
|
|
+ return s;
|
|
|
|
+ }
|
|
function loadXmlData() {
|
|
function loadXmlData() {
|
|
var textData = Base64.decode($("#textData").val())
|
|
var textData = Base64.decode($("#textData").val())
|
|
|
|
+ textData = htmlEscape(textData);
|
|
window.textPreData = "<xmp style='background-color: #FFFFFF;overflow-y: scroll;border:none'>" + textData + "</xmp>";
|
|
window.textPreData = "<xmp style='background-color: #FFFFFF;overflow-y: scroll;border:none'>" + textData + "</xmp>";
|
|
var xmlNode = xmlTreeViewer.parseXML(textData);
|
|
var xmlNode = xmlTreeViewer.parseXML(textData);
|
|
window.retNode = xmlTreeViewer.getXMLViewerNode(xmlNode.xml);
|
|
window.retNode = xmlTreeViewer.getXMLViewerNode(xmlNode.xml);
|