Package com.dtrules.xmlparser

Examples of com.dtrules.xmlparser.XMLPrinter


       return buff.toString();
   }
  
  
   public void compareEDD(OutputStream reportStream) throws Exception {
       XMLPrinter report = new XMLPrinter(reportStream);
       compareEDD(report);
   }
View Full Code Here


       return buff.toString();
   }
  
  
   public void compareMapping(OutputStream reportStream) throws Exception {
       XMLPrinter report = new XMLPrinter(reportStream);
       compareMapping(report);
   }
View Full Code Here

     * @param noSpaces
     * @return
     */
    public String xmlPull(boolean noSpaces){
        StringWriter sw = new StringWriter();
        XMLPrinter xout = new XMLPrinter(sw);
        xout.setNoSpaces(noSpaces);
        DataMap.print(xout, rootTag);
        return sw.toString();
    }
View Full Code Here

    /**
     * Write out this DataMap as an XML file
     * @param out
     */
    public void print(OutputStream out){
        XMLPrinter xout= new XMLPrinter(out);
        DataMap.print(xout,rootTag);
    }
View Full Code Here

                  entityfile = new FileOutputStream(getOutputDirectory()+root+"_entities_before.xml");
                  RArray entitystack = new RArray(0,false,false);
                  for(int i=0; i< session.getState().edepth()-2; i++){
                      entitystack.add(session.getState().entityfetch(i));
                  }
                  session.printEntityReport(new XMLPrinter(entityfile), false, session.getState(), "entitystack", entitystack);
              }
             
              // Once the data is loaded, execute the rules.
              RulesException ex = null;
              try{
                  executeDecisionTables(session);
              }catch(RulesException e){
                  ex = e;
              }
             
              // Then if asked, dump the entities.
              if(Verbose()){
                  entityfile = new FileOutputStream(getOutputDirectory()+root+"_entities_after.xml");
                  RArray entitystack = new RArray(0,false,false);
                  for(int i=0; i< session.getState().edepth()-2; i++){
                      entitystack.add(session.getState().entityfetch(i));
                  }
                  session.printEntityReport(new XMLPrinter(entityfile), false, session.getState(), "entitystack", entitystack);
               }
             
              if(ex!=null)throw ex;
             
              // Print the report
View Full Code Here

            throws Exception {
        RArray entitystack = new RArray(0,false,false);
        for(int i=0; i< session.getState().edepth()-2; i++){
            entitystack.add(session.getState().entityfetch(i));
        }
        session.printEntityReport(new XMLPrinter(out), false, session.getState(), "entitystack", entitystack);
    }
View Full Code Here

    public boolean compareNodes(Node thisResult, Node oldResult){
         return thisResult.absoluteMatch(oldResult, false);
     }
    
    public void compareTestResults() throws Exception {
        XMLPrinter report = new XMLPrinter(compareTestResultsReport());
        report.opentag("results");
        File outputs = new File(getOutputDirectory());
        if(outputs == null || !outputs.isDirectory()){
            System.out.println("'"+getOutputDirectory()+"' does not exist or is not a directory");
        }
        File files[] = outputs.listFiles();
        for(File file : files){
            if(file.getName().endsWith("_results.xml")){
                Node result1=null, result2=null;
                try{
                    result1 = XMLTree.BuildTree(new FileInputStream(file),false,false);
                    result2 = XMLTree.BuildTree(new FileInputStream(getResultDirectory()+file.getName()),false, false);
                    if(result1 != null && result2 != null){
                        if(compareNodes(result1,result2)){
                            report.printdata("match","file",file.getName(),"");
                        }else{
                            report.printdata("resultChanged","file",file.getName(),"");
                        }
                    }else{
                        report.printdata("error","file",file.getName(),"");
                    }
                }catch (Exception e){
                    report.printdata("unknown","file",file.getName(),"Missing Files to do the compare");
                }
            }
        }
        report.closetag();
    }
View Full Code Here

        return true;
    }
   
    public void generateMapping(String mapping, String inputfile, String outputfile) throws Exception {
        FileInputStream input = new FileInputStream(inputfile);
        XMLPrinter      out   = new XMLPrinter(new FileOutputStream(outputfile));
        generateMapping(mapping,input,out);
    }
View Full Code Here

    /* (non-Javadoc)
     * @see com.dtrules.mapping.IMapGenerator#generateMapping(java.lang.String, java.lang.String, java.lang.String)
     */
    public void generateMapping(String mapping, String inputfile, String outputfile) throws Exception {
        FileInputStream input = new FileInputStream(inputfile);
        XMLPrinter      out   = new XMLPrinter(new FileOutputStream(outputfile));
        generateMapping(mapping,input,out);
    }
View Full Code Here

                  entityfile = new FileOutputStream(getOutputDirectory()+number+root+"_entities_before.xml");
                  RArray entitystack = new RArray(0,false,false);
                  for(int i=0; i< session.getState().edepth()-2; i++){
                      entitystack.add(session.getState().entityfetch(i));
                  }
                  session.printEntityReport(new XMLPrinter(entityfile), false, false, session.getState(), "entitystack", entitystack);
              }
             
              // Once the data is loaded, execute the rules.
              RulesException ex = null;
              try{
                  executeDecisionTables(session);
              }catch(RulesException e){
                  ex = e;
              }
             
              // Then if asked, dump the entities.
              if(Verbose()){
                  entityfile = new FileOutputStream(getOutputDirectory()+number+root+"_entities_after.xml");
                  RArray entitystack = new RArray(0,false,false);
                  for(int i=0; i< session.getState().edepth()-2; i++){
                      entitystack.add(session.getState().entityfetch(i));
                  }
                  session.printEntityReport(new XMLPrinter(entityfile),false, false, session.getState(), "entitystack", entitystack);
               }
             
              if(ex!=null)throw ex;
             
              // Print the report
View Full Code Here

TOP

Related Classes of com.dtrules.xmlparser.XMLPrinter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.