protected void dfsCopy( BranchNode dst, BaseNode src, Map stopNodes ) { BranchNode copied = new BranchNode( src.getContent() ); dst.addChild( copied ); if( stopNodes != null && stopNodes.containsKey(src) ) { stopNodes.put(src,copied); return; } for( int i =0;i<src.getChildCount();i++) dfsCopy( copied, src.getChild(i), stopNodes );
protected void dfsCopy( BranchNode dst, Node src, Map stopNodes, Object srcId ) { if( src == DONT_EXPAND_COPY ) { if( stopNodes != null && stopNodes.size() > 0 ) throw new IllegalStateException("Can't use noexpand with truncated subtrees"); AttributesImpl atts = new AttributesImpl(); atts.addAttribute("","",Diff.DIFF_CPYSRC_ATTR,"CDATA",srcId.toString()); BranchNode node = new BranchNode( new XMLElementNode( Diff.DIFF_COPY_TAG, atts )); dst.addChild(node); } else dfsCopyTree(dst,src,stopNodes);
  protected void dfsCopy( BranchNode dst, BaseNode src, Map stopNodes ) {    BranchNode copied = new BranchNode( src.getContent() );    dst.addChild( copied );    if( stopNodes != null && stopNodes.containsKey(src) ) {      stopNodes.put(src,copied);      return; // We're done in this branch    }    for( int i =0;i<src.getChildCount();i++)      dfsCopy( copied, src.getChild(i), stopNodes );  }