如果属性不存在,我正在尝试添加它。它应该很简单,但我是 XML XPath/XQuery/etc. 的新手,所以请原谅我的无知。
我希望能够传递 XML 数据并对其进行修改...
ALTER FUNCTION [dbo].[ConvertXmlData](@xmlData XML)
RETURNS XML
AS
BEGIN
RETURN @xmlData.<something here>
END
如果我传递如下数据:
<something>
this is sample data <xxx id="1"/> and <xxx id="2" runat="server" />. More <yyy id="3" />
</something>
我想
<something>
this is sample data <xxx id="1" runat="server" /> and <xxx id="2" runat="server" />. More <yyy id="3" />
</something>
并不是 :
<something>
this is sample data <xxx id="1" runat="server" /> and <xxx id="2" runat="server" runat="server"/>. More <yyy id="3" />
</something>