Package com.thaiopensource.relaxng.input

Examples of com.thaiopensource.relaxng.input.InputFormat


  }
 
  public static void generateXSDFromDTD(File input, File output) throws Exception {
    ErrorHandlerImpl eh = new ErrorHandlerImpl();
    OutputFormat of = new XsdOutputFormat();
    InputFormat inFormat = new DtdInputFormat();
    SchemaCollection sc = inFormat.load(
        UriOrFile.toUri(input.getAbsolutePath()), new String[0], "xsd", eh);
   
    OutputDirectory od = new LocalOutputDirectory(
        sc.getMainUri(),output,"xml","utf-8",80,4);
   
View Full Code Here


   * @throws Exception
   */
  public static void generateDTDFromXML(File input,File output) throws Exception {
    ErrorHandlerImpl eh = new ErrorHandlerImpl();
    OutputFormat of = new DtdOutputFormat();
    InputFormat inFormat = new XmlInputFormat();
    SchemaCollection sc = inFormat.load(
        UriOrFile.toUri(input.getAbsolutePath()), new String[0], "dtd", eh);
   
    OutputDirectory od = new LocalOutputDirectory(
        sc.getMainUri(),output,"xml","utf-8",80,4);
   
View Full Code Here

   * @throws Exception
   */
  public static void generateXSDFromXML(File input,File output) throws Exception {
    ErrorHandlerImpl eh = new ErrorHandlerImpl();
    OutputFormat of = new XsdOutputFormat();
    InputFormat inFormat = new XmlInputFormat();
    SchemaCollection sc = inFormat.load(
        UriOrFile.toUri(input.getAbsolutePath()), new String[0], "xsd", eh);
   
    OutputDirectory od = new LocalOutputDirectory(
        sc.getMainUri(),output,"xml","utf-8",80,4);
   
View Full Code Here

    String rngSchemaName = schemaPath.substring(schemaPath.lastIndexOf('/') + 1).replaceAll("\\.rnc$", ".rng");
    File rngOutputFile = new File(Files.createTempDir(), rngSchemaName);
   
    try {
      String rncFilePath = SchemaConverter.class.getClassLoader().getResource(schemaPath).toString().replace('\\', '/').replaceAll(" ","%20");
      InputFormat inputFormat = Formats.createInputFormat("rnc");
      OutputFormat outputFormat = Formats.createOutputFormat("rng");
      String[] inputOptions = {};
      SchemaCollection schemaCollection = inputFormat.load(rncFilePath, inputOptions, "rng", new ErrorHandlerImpl(), null);
      OutputDirectory outputDirectory = new LocalOutputDirectory(schemaCollection.getMainUri(), rngOutputFile, "rng", "UTF-8", 72, 2);
      String[] outputOptions = {};
     
      outputFormat.output(schemaCollection, outputDirectory, outputOptions, "rnc", new ErrorHandlerImpl());
    }
View Full Code Here

   * @throws Exception
   */
  public static void generateXSDFromDTD(File input, File output) throws Exception {
    ErrorHandlerImpl eh = new ErrorHandlerImpl();
    OutputFormat of = new XsdOutputFormat();
    InputFormat inFormat = new DtdInputFormat();
    SchemaCollection sc = inFormat.load(
        UriOrFile.toUri(input.getAbsolutePath()), new String[0], "xsd", eh);
   
    OutputDirectory od = new LocalOutputDirectory(
        sc.getMainUri(),output,"xml","utf-8",80,4);
   
View Full Code Here

   * @throws Exception
   */
  public static void generateDTDFromXML(File input,File output) throws Exception {
    ErrorHandlerImpl eh = new ErrorHandlerImpl();
    OutputFormat of = new DtdOutputFormat();
    InputFormat inFormat = new XmlInputFormat();
    SchemaCollection sc = inFormat.load(
        UriOrFile.toUri(input.getAbsolutePath()), new String[0], "dtd", eh);
   
    OutputDirectory od = new LocalOutputDirectory(
        sc.getMainUri(),output,"xml","utf-8",80,4);
   
View Full Code Here

   * @throws Exception
   */
  public static void generateXSDFromXML(File input,File output) throws Exception {
    ErrorHandlerImpl eh = new ErrorHandlerImpl();
    OutputFormat of = new XsdOutputFormat();
    InputFormat inFormat = new XmlInputFormat();
    SchemaCollection sc = inFormat.load(
        UriOrFile.toUri(input.getAbsolutePath()), new String[0], "xsd", eh);
   
    OutputDirectory od = new LocalOutputDirectory(
        sc.getMainUri(),output,"xml","utf-8",80,4);
   
View Full Code Here

TOP

Related Classes of com.thaiopensource.relaxng.input.InputFormat

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.