Package org.apache.xmlbeans.samples.datetime

Examples of org.apache.xmlbeans.samples.datetime.DatetimeDocument


    {
        // Create an instance of this sample to work with.
        DateTime sample = new DateTime();

        // Create an schema type instance from the XML indicated by the path.
        DatetimeDocument doc = sample.parseXml(args[0]);

        sample.printInstance(doc);

        // Validate the XML.
        boolean exampleIsValid = sample.validateXml(doc);
View Full Code Here


   public static void main(String args[]){
       // Create an instance of this class to work with.
       DateTime dt = new DateTime();

       // Create an instance of a Datetime type based on the received XML's schema
       DatetimeDocument doc = dt.parseXml(args[0]);

       // Prints the element values from the XML
       dt.printInstance(doc);

       // Creates a new XML and saves the file
View Full Code Here

   public DatetimeDocument parseXml(String file){
       // Get the XML instance into a file using the path provided.
       File xmlfile = new File(file);

       // Create an instance of a type generated from schema to hold the XML.
       DatetimeDocument doc = null;

       try {
           // Parse the instance into the type generated from the schema.
           doc = DatetimeDocument.Factory.parse(xmlfile);
       }
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.samples.datetime.DatetimeDocument

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.