import java.io.*;
import org.exolab.castor.xml.MarshalException;
import OOP2002Example.*;

public class example3
{
   public static void main(String[] argv)
   {
	   try
	   {
	      Pkw myPkw = Pkw.unmarshal(new FileReader( argv[0] ));

	      //setting an attribute
	      myPkw.setNummer("UL-A 1234");

         //setting a element's content
         myPkw.getGewicht().setLeergewicht(1520);

         myPkw.marshal(new FileWriter(argv[1]));
      } //try
      catch (MarshalException e)
      {
         Exception originatingException = e.getException();
         if (originatingException != null)
         {
            System.out.println(originatingException);
         } //if
      } //catch
      catch (Exception e)
      {
         System.out.println("EXCEPTION: "+e);
      }
   } //main()
} //class example3