0

How would I go about telling NSXMLParser to stop parsing a particular node, and just return all the inner content as a string?

for example:

<doc>
<hello><yes>no</yes><hello>
</doc>

i want to return <yes>no</yes> as a string, rather than drill down further

gypsyDev
  • 1,232
  • 1
  • 14
  • 22
  • Change `no` to `<yes>no</yes>` in the XML file and it will be treated at text. No need to fool the parser. – rmaddy May 26 '17 at 04:17
  • Tell us what problem you are trying to solve, and perhaps we can suggest a way of solving it that isn't quite so crazy. – Michael Kay May 26 '17 at 08:44
  • I am parsing Xliff files which sometimes places empty nodes within nodes to signify object placement. Currently I have no way of finding the position of the empty node within the target node to be able to recreate the Xliff file when I save. A better (simplified) example would be like so: hello my name is I need to be able to recreate this structure. I could quite easily do this if nsxmlparser would return the entire target node. – gypsyDev May 26 '17 at 11:27

0 Answers0