不好意思,第二行代码中的ModifyStatConfigData应该改为:MyXml
解决方案 »
- 怎么实现全文中用javascript中去除指两个字符串之间以及这两个字符串的内容
- 请教一个JS中关于汉字的正则验证问题
- this.ConfirmEdit is not a function是什么错误?
- 如何监控一个xml数据岛被更改了,那些节点被更改了
- 为什么不能插入表格?
- 只有450K的搜索软件,完全基于javascript,支持无刷新.欢迎大家测试,同时也希望和大家一起讨论
- 不同窗口传值问题?
- 关于checkbox!!着急
- 如何让复选框不可选?
- 使用window.open("xxx.asp?xxx","_top"....);打开窗口,这个xxx参数如何写?
- 請問當我用下拉框時,如果選了特定的內容後就彈出窗口,怎樣寫>
- 如何知道鼠标放置在表格上是第几行?
-----------------------------------------------
你是如何处理将来自请求中的xml文件转换为字符串的?
<?xml version="1.0" encoding="GB2312"?>
<ServerList>
<Server>
<ServerType>String</ServerType>
<ServerName>String</ServerName>
<Status>String</Status>
<StartTime>String</StartTime>
<Describing>String</Describing>
</Server>
</ServerList>当我执行语句: alert(MyXml.xml)时,弹出的内容如下:
<?xml version="1.0"?>
<ServerList>
<Server>
<ServerType>String</ServerType>
<ServerName>String</ServerName>
<Status>String</Status>
<StartTime>String</StartTime>
<Describing>String</Describing>
</Server>
</ServerList>encoding="GB2312" 这一部分丢失,将该XML文件上传到服务器端也是这样的。为什么?
<input type="text" name="ipXml">
</form>JS如下: frmSend.ipXml.value = MyXml.xml;
frmSend.submit();
----------------------------------------------
<%
var doc = new ActiveXObject("Msxml2.DOMDocument.5.0");
... ...
Response.ContentType = "text/xml";
Response.Write(doc.xml);
%>试试看这样:
<%
var doc = new ActiveXObject("Msxml2.DOMDocument.5.0");
... ...
Response.ContentType = "text/xml";
doc.save(Response);
%>
---------------------------------------------
The xml property always returns a Unicode string. That is, the xml property for DOMDocument converts the document from its original encoding to Unicode. As a result, the original encoding attribute is removed. For example, <?xml version="1.0" encoding="UTF-8"?> appears in the xml property as follows.<?xml version="1.0"?>
If the original encoding was not removed by the xml property, the following line returns an error indicating the parser cannot switch from Unicode to UTF-8 encoding.xmlDoc.loadxml(xmlDoc.xml);
If you use the save method, the original encoding is preserved. For example, if you load a document in Microsoft® Windows® 1252 encoding, it will be saved in that format.
var piXML = MyXml.createProcessingInstruction("xml", 'version="1.0" encoding="GB2312"');
MyXml.insertBefore(piXML, MyXml.firstChild);不知是不是IE自动将encoding部分去掉了?
------------------------------------
<form name="frmSend" action="...." method="post">
<input type="text" name="ipXml">
<input type="text" name="xmlEncode" value="gb2312">
</form>