     }
     
     func parser(_ parser: XMLParser, foundCharacters string: String) {
-        if self.insideVerses && self.insideFootnote == 0 {
+        if self.insideVerses && self.stack.count < self.insideFootnote {
             self.result.append(string)
         }
-        //if self.insideVerses {
-        //    print("Inside verse |\(string)|")
-        //}
-        //else if self.insideFootnote > 0 {
-        //    print("Exlude footnote |\(string)|")
-        //}
-        //else {
-        //    let str = string.trimmingCharacters(in: .whitespacesAndNewlines)
-        //    if str.count > 0 {
-        //        let tabs = String(repeating: "  ", count: self.stack.count + 1)
-        //        print("**\(tabs)\(string.trimmingCharacters(in: .whitespacesAndNewlines))")
-        //    }
-        //}
     }
     
     func parser(_ parser: XMLParser, parseErrorOccurred parseError: Error) {

                namespaceURI: String?, qualifiedName qName: String?,
                attributes attributeDict: [String : String] = [:]) {
        self.stack.append(elementName)
        //let tabs = String(repeating: "  ", count: self.stack.count)
        //print("**\(tabs)<\(elementName)>")
        if elementName == "span" {
            if let id:String = attributeDict["id"] {
                let parts = id.split(separator: ":")

    
    func parser(_ parser: XMLParser, didEndElement elementName: String,
                namespaceURI: String?, qualifiedName qName: String?) {
        let last = self.stack.popLast()
        if last != elementName {
            print("XML element mismatch error \(elementName)")
