I already know how to parse XML Elements that contain content (<this> Content </this>
in Objective C but I am currently using a web service that returns the content I need in between two closed elements (<begin-paragraph/> The content I need <end-paragraph/>
) I have been looking online for any examples of anyone else doing this, but I could not find anything. If anyone knows how to read between the two empty elements and would care to share, I would appreciate that very much.
相关问题
- Illegal to have multiple roots (start tag in epilo
- Correctly parse PDF paragraphs with Python
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
相关文章
- 现在使用swift开发ios应用好还是swift?
- Creating XML Elements without namespace declaratio
- Get Attribute Value From Simple XML Using JQuery /
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- How do I get from a type to the TryParse method?
- Unable to process app at this time due to a genera
I don't know what the DOM conformance on the iPhone is like, but the general procedure would be:
<begin-paragraph />
in your DOM.<end-paragraph />
I have to say I regard that as an abuse of XML.
But I've checked and sadly it is well formed so NSXMLParser (which I assume is what you are using) should be able to cope with it.
You basically need to check which element you are in by handling the start element and end element events in your NSXMLParserDelegate. Then after receiving the
–parser:didEndElement:namespaceURI:qualifiedName:
message forbegin-paragraph
grab all the text you receive in-parser:foundCharacters:
until you receive–parser:didStartElement:namespaceURI:qualifiedName:attributes:
forend-paragraph