anchor.diff:  sax_f(Fun) ->
     fun(RawXML,O) -> 
         try [erlsom:sax(encoding(RawXML),[],sax_if(Fun))|O]
  -      catch error:R -> ?log([{erlang:get_stacktrace(),RawXML}]),exit(R)
  +      catch error:R -> ?log([{bt,erlang:get_stacktrace()},{doc,RawXML}]),
  +                       exit(R)
         end
     end.
   
  
positive.code: -define(tail_eof(Bin,Offset), {Bin,Offset,eof}).
  -define(state(Acc,Tail),      {Acc,Tail}).
  
  -define(log(T),error_logger:info_report(
                   [process_info(self(),current_function),{line,?LINE},T])).
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %%% the API
  
negative.code: %%% implementation
  fold(eof,_,Fun,Chunker,State) ->
    ?state(Acc,Tail) = folder(Chunker,Fun,state_eof(State)),
    [?log([{trailing,Tail}]) || not is_empty(Tail)],
    Acc;
  fold({ok,Chunk},FD,Fun,Chunker,State) -> 
    fold(read(FD),FD,Fun,Chunker,folder(Chunker,Fun,add_chunk(Chunk,State))).
  