Why doesn't IXMLNode.IsTextElement return True for CDATA elements?

冷暖自知 提交于 2019-12-05 19:55:26

It doesn't return true for Cdata nodes because that's just not the way it was written. It's unfortunate because consumers of XML data generally shouldn't be concerned with how text is represented in the serialized data. Your alternative is fine.

As Ritsaert Hornstra wrote in comment CDATA is not TEXT node of DOM tree. It's CDATA node.

Text property is something different. E.g. when current node is an attribute, Text will probably return value of this attribute.

If you want to check if current node is CDATA node or TEXT node, simply use Delphi is operator. There is also something like nodeType property which you are using anyway :-)

Erdinc Koroglu

If you want to check if current node is CDATA node or TEXT node, simply use Delphi is operator. There is also something like nodeType property which you are using anyway :-)

? XML CDATA read 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!