具有如下 XML 数据:
<List>
<Data>
<input1>1004519827</input1>
<input2></input2>
</Data>
<Data>
<input1>0214785698</input1>
<input2></input2>
</Data>
<Data>
<input1>1024589658</input1>
<input2></input2>
</Data>
</List>
想要解析<inpute>this</inpute1>
。我正在尝试从 sql 中解析:
select @Url = 'http://myurl/myval.ashx?command=Cancel&from=25.10.2013&to=25.10.2013'
Exec sp_OACreate 'MSXML2.XMLHTTP', @Object OUT;
Exec sp_OAMethod @Object, 'open', NULL, 'get', @Url, 'false'
Exec sp_OAMethod @Object, 'send'
Exec sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT
Exec sp_OADestroy @Object
Declare @XmlResponse as xml;
select @XmlResponse = CAST(@ResponseText as xml)
select @XmlResponse.value('(//List/Data/input1)[1]','varchar(50)')
但是当我执行程序时出现错误:非法 xml 字符 。我将 sp_configure 重新配置为 1