markAffected( affected, edits, true );
generalMarkAffected(affected,edits,editOp.getQName());
  public void runOOMarkup( String[] args ) {    BaseNode doc=null,docEdits=null;    if( args.length < 2 ) {        System.out.println("Usage: TreeDM OpenOfficefile editlog");        System.exit(0);    }    try {      XMLParser p = new XMLParser();      System.out.println("Parsing " + args [0]);      doc = (BaseNode) p.parse(args[0] ,baseNodeFactory);      System.out.println("Parsing " + args[1]);      docEdits =  (BaseNode) p.parse(args[1] ,baseNodeFactory);      System.out.println("OK.");    } catch ( Exception e ) {      e.printStackTrace();      System.exit(0);    }    // Put all edits in hashtable for later lookup    Map edits = new HashMap();    Node docRoot = doc; //.getChildAsNode(0);    Node logRoot = docEdits.getChild(0);    for( int i=0;i<logRoot.getChildCount();i++ ) {      XMLElementNode editOp = (XMLElementNode) logRoot.getChildAsNode(i).getContent();      if( !"delete".equals(editOp.getQName())) {        System.out.println(editOp.getQName() + ":" + editOp.getAttributes().getValue("path"));        try {          Node affected = followPath( docRoot, editOp.getAttributes().getValue("path") );          edits.put(affected,editOp);        } catch (Exception e ) {          System.err.println("HTBUILD: Path failure...");        }      }    }    for( int i=0;i<logRoot.getChildCount();i++ ) {      XMLElementNode editOp = (XMLElementNode) logRoot.getChildAsNode(i).getContent();      if( !"delete".equals(editOp.getQName())) {        try {          Node affected = followPath( docRoot, editOp.getAttributes().getValue("path") );          markAffected( affected, edits, true );        } catch (Exception e ) {          System.err.println("MARKUP: Path failure...");          System.err.println( e.getClass().getName());        }      }    }    try {      XMLPrinter p = new XMLPrinter( new PrintWriter( new FileOutputStream( "marked.xml" ) ) );      p.startDocument();      dumpTree( docRoot.getChildAsNode(0), p );      p.endDocument();    } catch (Exception e ) {      System.err.println("DUMP TANKED!");    }  }