gpt4 book ai didi

xml - Crm 2011 Fetch XMl - 无效的 XML 问题,如何解决?

转载 作者:数据小太阳 更新时间:2023-10-29 02:16:33 26 4
gpt4 key购买 nike

我正在使用 fetch xml 从 ms crm 2011 实体中检索值。它抛出 INVALID XML 错误,示例 xml 如下:

<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>
<entity name='xyz_registrationanswer'>
<attribute name='xyz_registrationid' />
<attribute name='xyz_name' />
<filter type='and'>
<condition attribute='xyz_name' operator='in' >
<value>Do you want to subscribe to 1 & 2?</value>
</condition>
</filter> <order attribute='xyz_name' descending='false' />
</entity>
</fetch>

通过调查问题,我找到了原因,即 1 和 2 之间的 & 符号:

<value>Do you want to subscribe to 1 & 2?</value> 

1- 谁能帮我解决这个问题?

2- 我可以处理哪些其他非法字符?

问候。

最佳答案

XML 中有五个“非法”字符必须被编码为实体:

<作为
> 作为 >
'作为'
“作为”
& 作为 &

这就是 HttpUtility.HtmlEncode() 有效的作用。

还有其他一些字符,例如元音变音字符,在 HTML 中使用时应该进行编码,但对于 Unicode XML,只有这五个字符是绝对需要注意的。

关于xml - Crm 2011 Fetch XMl - 无效的 XML 问题,如何解决?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11341473/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com