我使用Libxml2来编码xml文件中的数据.我的数据包含"<"和">"等标签.当它转换为xml时,这些标签也会转换为"<"和">".有没有办法解决这个问题.我想在解码那个xml文件时将这些标签用作xml节点,因此CDATA不是解决此问题的方法.请为此提供任何解决方案.谢谢.
示例代码:
xmlNewChild(node, NULL, (xmlChar *)"ADDRESS", (xmlChar *)"<street>Park Street</street><city>kolkata</city>");
and output of above code is:
<person>
<ADDRESS><street>Park Street</street><city>Kolkata</city></ADDRESS>
Run Code Online (Sandbox Code Playgroud)