Examples of DiffXConfig


Examples of com.topologi.diffx.config.DiffXConfig

   */
  public static Node diff(Node xml1, Node xml2, String whitespace, String granularity)
      throws DiffXException, IOException {

    // Get the config
    DiffXConfig config = toConfig(whitespace, granularity);

    // Get Sequences
    DOMRecorder loader = new DOMRecorder();
    loader.setConfig(config);
    EventSequence seq1 = loader.process(xml1);
View Full Code Here

Examples of com.topologi.diffx.config.DiffXConfig

   * @return the Diff-X config for the specified arguments as String.
   */
  private static DiffXConfig toConfig(String whitespace, String granularity) {
    WhiteSpaceProcessing ws = WhiteSpaceProcessing.valueOf(whitespace);
    TextGranularity tg = TextGranularity.valueOf(granularity);
    return new DiffXConfig(ws, tg);
  }
View Full Code Here

Examples of com.topologi.diffx.config.DiffXConfig

    Reader xmlr2 = new StringReader(xml2);
   
    // output
    Writer out = new StringWriter();
   
    DiffXConfig diffxConfig = new DiffXConfig();
    diffxConfig.setIgnoreWhiteSpace(false);
    diffxConfig.setPreserveWhiteSpace(true);

    try {
      Main.diff(toNode(xmlr1, true), toNode(xmlr2, true), out, diffxConfig);
        // The signature which takes Reader objects appears to be broken
      out.close();
View Full Code Here

Examples of com.topologi.diffx.config.DiffXConfig

  public static void diff(Node xml1, Node xml2, Writer out) // swapped,
      throws DiffXException, IOException {

    try {
      DiffXConfig diffxConfig = new DiffXConfig();
      diffxConfig.setIgnoreWhiteSpace(false);
      diffxConfig.setPreserveWhiteSpace(true);

      log(xml1.getNodeName());
      log(""+ xml1.getChildNodes().getLength());
      log(xml2.getNodeName());
      log(""+ xml2.getChildNodes().getLength());
View Full Code Here

Examples of com.topologi.diffx.config.DiffXConfig

    // records the events from the XML
    SAXRecorder recorder = new SAXRecorder();
    EventSequence seq1 = recorder.process(new InputSource(xml1));
    EventSequence seq2 = recorder.process(new InputSource(xml2));
    // start slicing
    diff(seq1, seq2, out, new DiffXConfig());
  }
View Full Code Here

Examples of com.topologi.diffx.config.DiffXConfig

      throws DiffXException, IOException {
    // records the events from the XML
    SAXRecorder recorder = new SAXRecorder();
    EventSequence seq1 = recorder.process(new InputSource(xml1));
    EventSequence seq2 = recorder.process(new InputSource(xml2));
    diff(seq1, seq2, new OutputStreamWriter(out), new DiffXConfig());
  }
View Full Code Here

Examples of com.topologi.diffx.config.DiffXConfig

      if (profile) {
        System.err.println("Loaded files in "+(t1 - t0)+"ms");
      }

      // get the config
      DiffXConfig config = new DiffXConfig();
      config.setGranularity(getTextGranularity(args));
      config.setWhiteSpaceProcessing(getWhiteSpaceProcessing(args));
      if (!quiet) {
        System.err.println("Whitespace processing: "+getTextGranularity(args)+" "+getWhiteSpaceProcessing(args));
      }

      // get and setup the formatter
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.