无效的Xml字符 [英] Non Valid Xml Characters
本文介绍了无效的Xml字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在BizTalkServer中传递NonValidXmlCharacters?
在这里,我正在使用脚本功能来传递NonValidXmlCharacters
在加密函数中,我使用内联c#:
下面的代码我已经写了,但是没有发送一些无效的字符
How to Pass NonValidXmlCharacters in BizTalkServer?
Here I''m using scripting function to pass NonValidXmlCharacters
In scipting function I''m using inline c#:
below following code I have written but it is not sending some non valid characters
public String stripNonValidXMLCharacters(String in)
{
StringBuilder out = new StringBuilder();
char current;
if (in == null || ("".equals(in))) return "";
for (int i = 0; i < in.length(); i++)
{
current = in[i];
if ((current == 0x9) ||
(current == 0xA) ||
(current == 0xD) ||
((current >= 0x20) && (current <= 0xD7FF)) ||
((current >= 0xE000) && (current <= 0xFFFD)) ||
((current >= 0x10000) && (current <= 0x10FFFF)))
out.append(current);
}
return out.toString();
}
我作为输入发送的数据是:"dsdfjhdskjjdkldskjd",hdjgshsg#* jhj%@&"
Data I''m sending as input is: "dsdfjhdskjjdkldskjd",hdjgshsg#*jhj%@&"
推荐答案
您可以使用此System.Security.SecurityElement.Escape()
方法.
实际上,它将使用有效的xml表示形式替换字符.
---糟糕.没关系,您正在谈论biztalk ...
You could use this theSystem.Security.SecurityElement.Escape()
method.
It will actually replace the characters with valid xml representations.
--- Oops. Nevermind, you''re talking about biztalk...
这篇关于无效的Xml字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文