在SQL中,如何在不使用<;的情况下将属性值中的一个作为XML形成XML输出&燃气轮机;编码的
我正在尝试一个查询,该查询返回一个属性值为XML且不编码的XML输出 示例:在SQL中,如何在不使用<;的情况下将属性值中的一个作为XML形成XML输出&燃气轮机;编码的,sql,xml,Sql,Xml,我正在尝试一个查询,该查询返回一个属性值为XML且不编码的XML输出 示例: <Event EventLogId="124018" EventCategoryCode="ABC" EventTypeCode="ERROR" xmlObject="<attributes><attribute>A1</attribute></attributes>" /> <Event EventLogId="124
<Event EventLogId="124018" EventCategoryCode="ABC"
EventTypeCode="ERROR"
xmlObject="<attributes><attribute>A1</attribute></attributes>" />
<Event EventLogId="124019" EventCategoryCode="DEF"
EventTypeCode="Warning"
xmlObject="<attributes><attribute>A2</attribute></attributes>" />
但是我得到了这个输出
<Event EventLogId="124018" EventCategoryCode="ABC"
EventTypeCode="ERROR"
xmlObject="<attributes><attribute>A1</attribute></attributes>" />
<Event EventLogId="124019" EventCategoryCode="DEF"
EventTypeCode="Warning"
xmlObject="<attributes><attribute>A2</attribute<</attributes>" />
我想用
代替
和
在属性中或XML中的任何位置具有非转义(即非实体编码)字符是无效的
100%准确地说,在我得到很多评论之前,您可以使用特殊的数据语法,但这在属性中是不合法的。此外,很少看到使用此功能
您可以在这里阅读标准()基本XML标准实际上很短,阅读不到一个小时。不能这样做——这不是合法的XML。任何XML阅读器都应该能够为您翻译/反实体化它。
<Event EventLogId="124018" EventCategoryCode="ABC"
EventTypeCode="ERROR"
xmlObject="<attributes><attribute>A1</attribute></attributes>" />
<Event EventLogId="124019" EventCategoryCode="DEF"
EventTypeCode="Warning"
xmlObject="<attributes><attribute>A2</attribute<</attributes>" />