tags:

views:

34

answers:

1

I am using some library: org.dom4j. I am beginer in JAVA. I want to know how get all childs in Node Books (i have sections, author in other info (not the some in all books node))

java.util.List BookList  = xmlDocument.selectNodes("/BooksList/Books");
Iterator Biterator = BookList .iterator();
while(Biterator.hasNext()){
    Element book = null;
    book = (Element)Biterator.next();
}

XML:

<BooksList>
    <Books name="Three kingdom">
        <author name="Title">
        <sections  number="216">
    </Books>
    <Books name="Frog and king">
        <author name="Title s">
        <sections  number="21">
        <pages number="421">
    <Books>
 </BooksList>