Package factbookxml.converter.schema

Examples of factbookxml.converter.schema.Factbook


  private final Map<Integer, String> fieldIDs = new HashMap<Integer, String>();

  public SQLRoundtripParser(Connection conn, String version) {
    this.conn = conn;
    this.version = version;
    this.doc = new Factbook();
  }
View Full Code Here


    long start = System.currentTimeMillis();
    JAXBContext ctx = JAXBContext.newInstance(factbookxml.converter.schema.ObjectFactory.class.getPackage().getName());
    marshaller = ctx.createMarshaller(); // no schema here!
    Unmarshaller u = ctx.createUnmarshaller();
    u.setSchema(SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(SQLBuilder.class.getResource("/factbook.xsd")));
    Factbook doc = (Factbook) u.unmarshal(new File(WORKPATH, "factbook.xml"));
    Properties props = new Properties();
    props.put("user", args[3]);
    props.put("password", args[4]);
    Connection conn = DriverManager.getConnection(args[2], props);
    SQLBuilder builder = new SQLBuilder(doc, conn);
    String version = builder.version;
    System.out.println("Version: " + version);
    builder.build();
    SQLRoundtripParser parser = new SQLRoundtripParser(conn, version);
    parser.parseBack(formatDate(doc.getLastupdate()));
    verify(Factbook.class, doc, parser.getFactbook());
    System.out.println("Finished: " + (System.currentTimeMillis() - start) + " ms.");
  }
View Full Code Here

    WORKPATH=new File(args[1]);
    long start = System.currentTimeMillis();
    JAXBContext ctx = JAXBContext.newInstance(factbookxml.converter.schema.ObjectFactory.class.getPackage().getName());
    Unmarshaller u = ctx.createUnmarshaller();
    u.setSchema(SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(PDABuilder.class.getResource("/factbook.xsd")));
    Factbook doc = (Factbook) u.unmarshal(new File(WORKPATH, "factbook.xml"));
    new PDABuilder(doc, "ebook", "../graphics", false).build();
    buildMobi();
    new PDABuilder(doc, "offline", "../graphics", true).build();
    new PDABuilder(doc, "mobile", "https://www.cia.gov/library/publications/the-world-factbook/graphics", true).build();
    new PDABuilder(doc, null, "../graphics", false).build();
View Full Code Here

TOP

Related Classes of factbookxml.converter.schema.Factbook

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.