missing } in XML expression
本次遇到的问题是:在上传文件时,返回的json数据被加上了<pre></pre>标签。(在普通的表单提交并不会加上<pre>标签)
利用firebug查看错误信息为:
missing } in XML expression (<pre>{success:true, msg:'成功'}</pre>)
对此问题解决如下:
对response对象设置返回类型:resp.setContentType("text/html");
这样就能正确显示json数据了
相关文档:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:XML id="xmlSource">
<node label="grandFather" state="unchecked">
<node label="Father" state="un ......
<%
'
Set http=Server.CreateObject("Microsoft.XMLHTTP")
http.Open "GET","http://127.0.0.1/1.xml",False
http.send
Dim xml
Set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = False
'xml.load (Server.MapPath("1.xml")) '如果不是远程文件直接这一步
xml.Load(http.ResponseXML)
Dim t ......
<?
/**
* xml2array() will convert the given XML text to an array in the XML structure.
* Link: http://www.bin-co.com/php/scripts/xml2array/
* Arguments : $contents - The XML text
* $get_attributes - 1 or 0. If this is 1 the function will get the attributes as well as the ......
同步程序案例
procedure TGetOrderThread.PostDB(webnr:WideString);
var
Err: String;
SetWebnr:WideString;
xmlDoc: IXMLDocument;
root: IXMLNode;
rowc: IXMLNode;//记录数
rows: IXMLNodeList;//主记录列表
row: IXMLNode;
drows: IXMLNodeList;// ......
在java应用开发中我们和xml打交道得机会太平凡了,一般情况下我看会用JDOM或是DOM4j来解析我们得XML文件,下面是一个Dom4j解析xml文件得例子,其中包括了对xml文件得取值、赋值、提取节点、节点得遍历等。
SAXReader reader =
new
SAXReader();
Document doc = reader.read(...); &nb ......