Access a sublevel from sections collected with findBy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Access a sublevel from sections collected with findBy

ch007m
Hi

Is it possible to access easily a sublevel section from a node calculated using findBy ?

Example
== Introduction
Ipsum lorem, ipsum lorem

== Command: 1
Ipsum lorem, ipsum lorem
=== Description
Ipsum lorem, ipsum lorem
Ipsum lorem, ipsum lorem

== Command: 2
Ipsum lorem, ipsum lorem
=== Description
Ipsum lorem, ipsum lorem
Ipsum lorem, ipsum lorem

Code used to findBy with selector
        Map<Object, Object> selector = new HashMap<Object, Object>();
        selector.put("context", ":section");

        // Search about the sections within the document ==> Then we will get 5 sections 
        List<StructuralNode> findBy = node.findBy(selector);

        // Search about the section where text is starting with "Command" word
        for (int i = 0; i < findBy.size(); i++) {
            final StructuralNode subNode = findBy.get(i); 
            if (subNode.getTitle().startsWith("Command") {
            // HOW CAN I NOW GET THE SUBLEVEL 3 CONTAINING THE TEXT OF THE DESCRIPTION

Best

Charles
Charles Moulliard
Apache Committer / Technologist Evangelist / Blogger / MiddleWare Specialist
Twitter : @cmoulliard