Ok - I found  solution for  XML defined document :-) - with chapter numbers:
 
 change code in:
 
SAXiTextHandler class
 
public void handleStartingTags(String name, Properties attributes) {
  ....................................................
 
          // chapters
        if (Chapter.isTag(name)) {
            String depth;
            if ((depth = attributes.getProperty(ElementTags.DEPTH)) != null){
                 chapters = Integer.parseInt(depth);
             }
            else {
               chapters++;
            }
            Chapter chapter = new Chapter(attributes,chapters);
            stack.push(chapter);
            return;
        }
 ......................................................
}
 
Now is you define "depth" attribtue in XML for your chapter it can fetch it
 easy ;-)
 
Strange that you define "depth" in elements tag - but did't catch it in parser
Anyway - lib. is great ;-)
 

Reply via email to