How do I parse the toc.ncx file within an ePub document and display its hierarchy?
How do I parse the toc.ncx file within an ePub document and display its hierarchy?
I have my application to read and display an ePub file almost ready.
What I am looking now into is, if my table of contents for the book has a hierarchical structure for chapters, topics and subtopics, how do I parse the toc.ncx file (which has an XML structure), and load the data in a UITableView while preserving the hierarchical structure?
1 Answer
1
You can use NSXMLParser to parse the toc.ncx file. It's pretty straight forward, you can find the documentation here.
Clearly, your question cannot be answered without more detailed information.
– Mundi
Mar 28 '12 at 17:09
Yup !!! Finally i got it... First i need to parse the XML and create a dictionary out of it... And then this NSDictionary can be easily displayed in UITableView in Hierarchical format !!
– Vineet Kundu
Mar 29 '12 at 5:34
Great! Consider putting a checkmark for the answer.
– Mundi
Mar 29 '12 at 6:02
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Thanks for your solution. I am actually able to parse the file succesfully, but i am facing trouble while getting the hierarchical details of the file and presenting the same hierarchy in the UITableView format.
– Vineet Kundu
Mar 28 '12 at 12:57