我收到错误:
路径中的非法字符。
当尝试使用 XPath 将 XML 加载到我正在构建的 ASP.NET 页面的代码隐藏中的 PageLoad 函数中的 gridview 数据源中时。有谁知道这个错误是什么意思?
来自 Sharepoint Web 服务调用的 XML 是:
<?xml version='1.0' encoding='ISO-8859-1'?>
<listitems xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<rs:data ItemCount="2">
<z:row ows_Attachments="0" ows_LinkTitle="testTitle" ows_IncidentID="0" .../>
<z:row ows_Attachments="0" ows_LinkTitle="test2" ows_IncidentID="1" ... />
</rs:data>
而我背后的代码是:
newNode = thisL.GetListItems(strID, viewName, query, viewFields, rowLimit, queryOptions, webID)
mNodeList = newNode.ChildNodes
Dim ds_me As New Data.DataSet
xdsIncidents.Data = "<?xml version='1.0' encoding='utf-8'?>" & newNode.OuterXml
xdsIncidents.XPath = "//z:row"
GridView1.AutoGenerateColumns = True
DataDiv.InnerText = xdsIncidents.Data
ds_me.ReadXml(xdsIncidents.Data)
Dim dv As New Data.DataView(ds_me.Tables(1))
GridView1.DataSource = dv
GridView1.DataBind()
错误消息出现在“ds_me.ReadXML ...”行上