     unless escalating then @saveSelection()
     path = @getPathTo node
     pathInfo = @allPaths[path]
+    unless pathInfo? then throw new Error "Can not find path info for path " + path
+    unless @mappings[path]? then throw new error "Can not find mappings for path " + path
 #    if escalating then console.log "(Escalated)"
 #    console.log "Updating data about " + path + ": "
     if pathInfo.node is node and pathInfo.content is @getNodeContent node

    xpath = xpath.replace /\/$/, ''
    xpath

  collectPathsForNode: (node) ->
    path = @getPathTo node
    cont = @getNodeContent node, false
    if cont.length then @allPaths[path] =
      path: path
      content: cont
      length: cont.length
      node : node
    
    if node.hasChildNodes
      children = node.childNodes
      i = 0
      while i < children.length
        @collectPathsForNode children[i]
        i++
    null


      sourceIndex++
    match.startCorrected = sourceStart
    match.endCorrected = sourceEnd
#    console.log "computeSourcePosition done. Corrected range is: " + match.startCorrected + "-" + match.endCorrected
    null

  # Internal function used to read out the text content of a given node, as render by the browser.
