【发布时间】:2015-05-07 16:36:34
【问题描述】:
我想替换 fetchxml 查询中的一些符号
Fetchxml.Replace("\"", "'").Replace("\n", "\"+").Replace("
我想用“+”替换\n(返回该行) 并将
示例 XML:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"> <entity name="account"> <attribute name="name" /> <filter type="and"> <condition attribute="statecode" operator="eq" value="0" /> </filter> <link-entity name="contact" from="contactid" to="primarycontactid" visible="false" link-type="outer" alias="accountprimarycontactidcontactcontactid"> <attribute name="emailaddress1" /> </link-entity> </entity> </fetch>
期望的输出:
<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"+ "<entity name='account'>"+ "<filter type='and'>"+ "<condition attribute='statecode' operator='eq' value='0' />"+ "</filter>"+ "</entity>"+ "</fetch>
【问题讨论】:
-
请举例说明您的 XML 的样子,尤其是之前和之后的样子。 “替换”可能不是一个好的选择,因为 XML 不能那样工作。
-
好吧,我的 fetchxml 就是这样 Fetxml = "
获取>"; -
在我希望它像那样之后,在我希望它像那样之后:Fetchxml=“
"+ " ";"+ " "+ ""+ " "+ ""+ " -
好的,你想用那个输出来完成什么?因为那看起来不再像 XML 了? (我已将您的 XML 编辑到问题中 - 我没有触及格式 - 您可能需要检查它,因为它可能很重要)。