TBXML不以特殊字符解析标签作为价值

TBXML不以特殊字符解析标签作为价值

问题描述:

我试图用TBXML来解析XML,一切都只是包含在他们的价值的特殊字符标签罚款去。TBXML不以特殊字符解析标签作为价值

例如,考虑 <tag> sources/data </tag>

我想从这个标签文本sources/data的XML元素。我使用[TBXML textForElement:element]实现这一目标。但它总是返回一个空字符串。 相同的代码失败对于其被定义为另一标签: <tag> array[i] </tag>

但它工作正常,正常的文本值一样 <tag>name</tag>

谁能帮助我在这里?

引用: “Because XML syntax uses some characters for tags and attributes it is not possible to directly use those characters inside XML tags or attribute values.

http://www.dvteclipse.com/documentation/svlinter/How_to_use_special_characters_in_XML.3F.html

据我所知这种数据必须在放置CDATA。