XMLCoder
XMLCoder copied to clipboard
How to stop parsing subnode from some lower level
Hi, Friends,
For XML string,
<book id="123">
<id>123</id>
<title>Cat in the Hat</title>
<category>Kids</category>
<category>Wildlife</category>
<description>Two bored children have their lives turned upside down when <italic>a talking cat</italic> comes to visit them.</description>
</book>
I hope the XMLCoder to parse tag id/title/category/description, not parse the tag
"Two bored children have their lives turned upside down when <italic>a talking cat</italic> comes to visit them."
instead of
"Two bored children have their lives turned upside down when a talking cat comes to visit them."
That means XMLCoder will stop to parse any node under tag description any more.
Is there any way to do so with XMLCoder?
Thanks in advance!
Hi @bitflying, unfortunately there's no way to handle it this way. This is a limitation of Apple's XMLParserDelegate
that Foundation provides. I don't think there's a way to tell Foundation's XML parser to avoid parsing content of a specific node.