如何使HXT库输出 CDATA?
例如,test
在此代码段中运行将导致
<?xml version="1.0" encoding="UTF-8"?>
<texts>hello<br>world!</texts>
import Text.XML.HXT.Core
hello :: ArrowXml a => a XmlTree XmlTree
hello =
mkelem "texts" [] [txt "hello<br>world!"]
test = runX $
root [] [hello]
>>>
writeDocument [withIndent yes] "somefile.xml"
但我需要它来渲染:
<?xml version="1.0" encoding="UTF-8"?>
<texts><![CDATA[hello<br>world!]]></texts>
是否可以HXT
自动检测是否需要 CDATA?