我搜索网络很多,并没有找到用他们的转义序列替换xml特殊字符的js函数?
有这样的事吗?
我知道以下内容:
Special Character Escape Sequence Purpose
& & Ampersand sign
' ' Single quote
" " Double quote
> > Greater than
< < Less than
Run Code Online (Sandbox Code Playgroud)
还有更多吗?怎么样写十六进制值如0×00,
这也是一个问题吗?
我有以下 XML 代码在我的 Crm Dynamics 表单中过滤我的查找字段。过滤器在输入到帐户字段的数据之后使用。但是,帐户字段可以包含&符号,当它包含时,会发生错误,指出 XML 格式不正确。
有没有人有任何解决问题的方法?
function accountcontact()
{
Xrm.Page.getControl("new_contactlookup").addPreSearch(function () { addcontactlookup(); });
function addcontactlookup()
{
var accountID = Xrm.Page.getAttribute("new_companylookup");
var AccountIDObj= accountID.getValue();
if (AccountIDObj != null)
{
var fetchFilter1 = "<filter type='and'><condition attribute='parentcustomerid' uitype='" + AccountIDObj[0].entityType + "' operator='eq' value='" + AccountIDObj[0].id + "' uiname='" + AccountIDObj[0].name + "' /></filter>";
Xrm.Page.getControl("new_contactlookup").addCustomFilter(fetchFilter1);
}
}
}
Run Code Online (Sandbox Code Playgroud) 我正在编写一个基本的 Chrome 扩展程序,以从 JSON 提要在多功能框中添加建议。几乎所有输入的查询都会在建议下拉菜单中按预期显示结果。
然而,似乎每当一个与号 (&) 作为描述的一部分被返回时,Chrome 就会抛出一个错误。
抛出的错误读取"xmlParseEntityRef: no name(...)"并从parseOmniboxDescriptionChrome 中的方法调用。
对此事的任何帮助将不胜感激。我不确定这是否是唯一有这个问题的角色,或者它是否更普遍。
javascript json google-chrome google-chrome-extension omnibox