SQL xml 元素值中的撇号

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5331580/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 09:43:51  来源:igfitidea点击:

APOSTROPHE inside xml element value

sqlxml

提问by Tintin

How Should I write an elements value inside an XML which contains apostrophe? Is there an escape sequence for the same?

我应该如何在包含撇号的 XML 中写入元素值?是否有相同的转义序列?

I am dynamically getting an xml, something like this from a sql Select. Now in this case emp_name O''DELL, SEAN in itself contains apostrophe. How should I be getting emp_name so a proper xml could be formed?

我正在从 sql Select 动态获取一个 xml,类似这样的东西。现在在这种情况下,emp_name O''DELL,SEAN 本身包含撇号。我应该如何获取 emp_name 以便可以形成正确的 xml?

<Result type="Benefit" emp_id='332' emp_name='O''DELL, SEAN '/>

Thanks Guys.

谢谢你们。

回答by amit_g

Use &apos;in place of '. Check this.

使用&apos;到位”。检查这个