//______________________________________________________________________________
//   |       |
//   | knipp |           Knipp Medien und Kommunikation GmbH
//    - - - -
//
//
//    DEMO-PROJECT
//
//    Copyright (C) 2008 by Knipp Medien und Kommunikation GmbH
//
//    initial author:    Elmar Knipp
//    version:           $Revision: 1.1 $
//                       $Date: 2008/03/26 16:03:55 $
//                       $Author: elmar $

package de.knipp.registryannouncements;

/**
 *  Demo program to read an annoucement file and create 
 *  an ASCII and iCal instance.<br>
 *
 *  It's just a self-explanatory example without real JavaDoc.
 */

public class Process
{
  private static String xsdFileName;
  private static String xmlFileName;
  private static String asciiFileName;
  private static String icalFileName;

  static final String JAXP_SCHEMA_LANGUAGE =
    "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
  static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
  static final String JAXP_SCHEMA_SOURCE =
    "http://java.sun.com/xml/jaxp/properties/schemaSource";

  
  /**
   * @param args           <ul>
   *                       <li>xsd file</li>
   *                       <li>xml input file</li>
   *                       <li>ascii output file</li>
   *                       <li>ical output file</li>
   *                       </ul>
   */
  public static void main (String[] args)
  {
    // check params
    if (args.length != 4) 
    {
      System.err.println ("wrong number of parameters");
      System.exit (-1);
    }
    xsdFileName = args[0];
    xmlFileName = args[1];
    asciiFileName = args[2];
    icalFileName = args[3];


    // operate
    Announcement a = new Announcement (xsdFileName, xmlFileName).getAnnouncement ();

    Ascii ascii = new Ascii (a);
    System.out.println (ascii.toString ());
    ascii.toFile (asciiFileName);

    ICal iCal = new ICal (a);
    System.out.println (iCal.toString ());
    iCal.toFile (icalFileName);
  }
}
