My xml file structure looks like this
<?xml version="1.0" encoding="utf-8" ?> <book> <chapters> <chapter id="1"> <page id="1" cid= "1" bid = "Book1"> <text>Hi</text> </page> <page id="2" cid= "1" bid = "Book1"> <text>Hi</text> </page> </chapter> <chapter id="2"> <page id="1" cid= "2" bid = "Book1"> <text>Hi</text> </page> <page id="2" cid= "2" bid = "Book1"> <text>Hi</text> </page> </chapter> <chapter id="3"> <page id="1" cid= "3" bid = "Book1"> <text>Hi</text> </page> <page id="2" cid= "3" bid = "Book1"> <text>Hi</text> </page> </chapter> </chapters> </book>
I want to get a specific node page by passing the page id and id head . How can i achieve this?
In addition, the node book contains too many chapters, and each chapter contains many pages. So, I use the SAX parser to parse the content.
source share