我在postgresql表中有一个xml类型列。我正在尝试使用表的某些列(也包括XML类型列)创建新的xml。
对于内部XML,我得到了" > 
 <
等特殊字符。
如何获取实际的标签和符号而不是这些字符?
下面是内部XML示例
<Detail>
<RuleDetail Name="Test">
<If>
<Conditions>
<Condition ConditionID="E4A073ED-A572-4CC5-AC68-835445C0DB6F"/>
</Conditions>
<Actions>
<Action ActionID="A959CF33-3537-486A-B6BB-2DBDFD7B32B9"/>
</Actions>
</If>
</RuleDetail>
</Detail>
下面是外部XML输出
<?xml version="1.0" encoding="UTF-8"?>
<Rules>
<Rule RuleID="6df3b89e-ef0f-4016-936c-0138d80b0c4e" Name="TODO: test1" SectionID="c8030a47-aa34-4d51-84ff-dcfe11e05599" Detail="<Detail>
 <RuleDetail Name="Test">
 <If>
 <Conditions>
 <Condition ConditionID="E4A073ED-A572-4CC5-AC68-835445C0DB6F"/>
 </Conditions>
 <Actions>
 <Action ActionID="A959CF33-3537-486A-B6BB-2DBDFD7B32B9"/>
 </Actions>
 </If>
 </RuleDetail>
 </Detail>" AddedDate="2019-03-07T13:46:13.543" DeleteFlag="false" />
</Rules>
下面是我正在使用的查询
Select XMLELEMENT(name "Rules",XMLAGG(XMLELEMENT(name "Rule", XMLATTRIBUTES(RuleID as "RuleID", Name as "Name", SectionID as "SectionID", Detail as "Detail", AddedDate as "AddedDate", ModifiedDate as "ModifiedDate", DeleteFlag as "DeleteFlag"))))
From RuleDetail
详细信息列为XML类型