解析xml文件独立于标记

时间:2022-12-01 11:09:28

I want to parse the xml file independent of the tags .So the code for the parsing should become generic one. Is there any way to do this in iPhone which is flexible with tags. I have tried to solve this problem by parsing the xml two times.In first parse i have extracted tags only and in second pass i tried to find the value of that tag. But there was the problems with this approach . So is there any api or logic to parse xml independent of tags? is it really possible?

我想独立于标签解析xml文件。因此,解析的代码应该是通用的。在iPhone中有没有办法做到这一点,这是灵活的标签。我试图通过解析xml两次来解决这个问题。在第一次解析时我只提取了标签,在第二次通过时我试图找到该标签的值。但是这种方法存在问题。那么有没有api或逻辑解析xml独立于标签?真的有可能吗?

1 个解决方案

#1


1  

In iOS there is no existing API or logic for parsing xml files with unknown tags. To parse xml you need to know tags of that xml.

在iOS中,没有用于解析具有未知标记的xml文件的现有API或逻辑。要解析xml,您需要知道该xml的标记。

#1


1  

In iOS there is no existing API or logic for parsing xml files with unknown tags. To parse xml you need to know tags of that xml.

在iOS中,没有用于解析具有未知标记的xml文件的现有API或逻辑。要解析xml,您需要知道该xml的标记。