copyAtts.addAttribute("","","src","CDATA", getId(child.getBaseMatch())); ch.startElement("","",DIFF_NS+"copy",copyAtts); copy( child.getBaseMatch(), child, ch ); ch.endElement("","",DIFF_NS+"copy"); } else insert( child, ch );
copyAtts.addAttribute("", "", "src", "CDATA", String.valueOf(getDiffId(child.getBaseMatch()))); ch.startElement("", "", DIFF_NS + "copy", copyAtts); Vector stopNodes = new Vector(); m.getAreaStopNodes(stopNodes, child); copy(child.getBaseMatch(), child, ch, stopNodes); ch.endElement("", "", DIFF_NS + "copy"); } else insert(child, ch);
  protected void insert( BranchNode branch, ContentHandler ch )                          throws SAXException {    XMLNode content = branch.getContent();    if( content instanceof XMLTextNode ) {      XMLTextNode ct = (XMLTextNode) content;      ch.characters(ct.getText(),0,ct.getText().length);    } else {      // Element node      XMLElementNode ce = (XMLElementNode) content;      boolean escape = RESERVED.contains(ce.getQName());      if( escape ) ch.startElement("","",DIFF_NS+"esc",EMPTY_ATTS);      ch.startElement(ce.getNamespaceURI(),ce.getLocalName(),ce.getQName(),ce.getAttributes());      if( escape ) ch.endElement("","",DIFF_NS+"esc");      for( int i=0;i<branch.getChildCount();i++) {        BranchNode child = branch.getChild(i);        if( child.hasBaseMatch() ) {          AttributesImpl copyAtts = new AttributesImpl();          copyAtts.addAttribute("","","src","CDATA",            getId(child.getBaseMatch()));          ch.startElement("","",DIFF_NS+"copy",copyAtts);          copy( child.getBaseMatch(), child, ch );          ch.endElement("","",DIFF_NS+"copy");        } else          insert( child, ch );      }      if( escape ) ch.startElement("","",DIFF_NS+"esc",EMPTY_ATTS);      ch.endElement(ce.getNamespaceURI(),ce.getLocalName(),ce.getQName());      if( escape ) ch.endElement("","",DIFF_NS+"esc");    }  }