Examples of OutputFormat


Examples of com.thaiopensource.relaxng.output.OutputFormat

    generateXSDFromDTD(new File("rc-config.dtd"), new File("rc-config.xsd"));
  }
 
  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);
   
    of.output(sc, od, new String[0], "xml", eh);
  }
View Full Code Here

Examples of com.volantis.xml.xml.serialize.OutputFormat

                parentDir.mkdirs();
            }

            writer = new FileWriter(debugOutputFile);

            OutputFormat format = new OutputFormat();
            format.setPreserveSpace(true);
            format.setOmitXMLDeclaration(true);
            xmlSerializer = new XMLSerializer(writer, format);
        }
        return xmlSerializer;
    }
View Full Code Here

Examples of mf.org.apache.xml.serialize.OutputFormat

                // there doesn't seem to be a way to reset a serializer, so we need to make
                // a new one each time.
                Serializer ser;
                if (streamResult.getWriter() != null) {
                    ser = fSerializerFactory.makeSerializer(streamResult.getWriter(), new OutputFormat());
                }
                else if (streamResult.getOutputStream() != null) {
                    ser = fSerializerFactory.makeSerializer(streamResult.getOutputStream(), new OutputFormat());
                }
                else if (streamResult.getSystemId() != null) {
                    String uri = streamResult.getSystemId();
                    OutputStream out = XMLEntityManager.createOutputStream(uri);
                    ser = fSerializerFactory.makeSerializer(out, new OutputFormat());
                }
                else {
                    throw new IllegalArgumentException(JAXPValidationMessageFormatter.formatMessage(fComponentManager.getLocale(),
                        "StreamResultNotInitialized", null));
                }
View Full Code Here

Examples of org.apache.hadoop.mapred.OutputFormat

    }
  }
 
  public OrcFileWriter(Configuration conf, Path path, PType<T> pType) throws IOException {
    JobConf jobConf = new JobConf(conf);
    OutputFormat outputFormat = new OrcOutputFormat();
    writer = outputFormat.getRecordWriter(null, jobConf, path.toString(), new NullProgress());
   
    mapFn = pType.getOutputMapFn();
    mapFn.initialize();
   
    serde = new OrcSerde();
View Full Code Here

Examples of org.apache.hadoop.mapreduce.OutputFormat

           
            // set output location
            PigOutputFormat.setLocation(jobContextCopy, store);
           
            StoreFuncInterface sFunc = store.getStoreFunc();
            OutputFormat of = sFunc.getOutputFormat();
           
            // The above call should have update the conf in the JobContext
            // to have the output location - now call checkOutputSpecs()
            of.checkOutputSpecs(jobContextCopy);
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.vault.util.xml.serialize.OutputFormat

        }
    }
    */

    public void save(OutputStream out) throws IOException {
        OutputFormat fmt = new OutputFormat("xml", "UTF-8", true);
        fmt.setLineWidth(0);
        fmt.setIndent(2);
        XMLSerializer ser = new XMLSerializer(out, fmt);
        try {
            write(ser);
        } catch (SAXException e) {
            throw new IOException(e.toString());
View Full Code Here

Examples of org.apache.lucene.gdata.server.GDataRequest.OutputFormat

    }

    private static abstract class FormatWriter{
       
        static FormatWriter getFormatWriter(final GDataResponse response, final ProvidedService service ){
            OutputFormat format = response.getOutputFormat();
            if(format == OutputFormat.HTML){
                return new HTMLFormatWriter(service);
            }
            return new SyndicateFormatWriter(service,format,response.getEncoding());
        }
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

   * Convert an XML document to a latin-1 string
   */
  public static String serializeXML(Document document) throws GUIException {
    try {
      StringWriter stringWriter = new StringWriter();
      OutputFormat format = new OutputFormat("XML", "ISO-8859-1", true);
      format.setLineWidth(0);
      XMLSerializer serializer = new XMLSerializer(stringWriter, format);
      serializer.asDOMSerializer().serialize(document);
      /* We don't want the newline character at the end */
      String string = stringWriter.toString();
      return string.substring(0, string.length() - 1);
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

        if (node == null) {
            return null;
        }
        try {
            Document doc = node.getOwnerDocument();
            OutputFormat format;
            if (doc != null) {
                format = new OutputFormat(doc, null, prettyPrint);
            } else {
                format = new OutputFormat("xml", null, prettyPrint);
            }
            if (prettyPrint) {
                format.setLineSeparator(LINE_SEP);
            } else {
                format.setLineSeparator("");
            }
            StringWriter writer = new StringWriter(1000);
            XMLSerializer serial = new XMLSerializer(writer, format);
            serial.asDOMSerializer();
            if (node instanceof Document) {
                serial.serialize((Document) node);
            } else if (node instanceof Element) {
                format.setOmitXMLDeclaration(true);
                serial.serialize((Element) node);
            } else if (node instanceof DocumentFragment) {
                format.setOmitXMLDeclaration(true);
                serial.serialize((DocumentFragment) node);
            } else if (node instanceof Text) {
                Text text = (Text) node;
                return text.getData();
            } else if (node instanceof Attr) {
View Full Code Here

Examples of org.apache.xml.serialize.OutputFormat

        StringWriter tXMLWriter = new StringWriter();

        try
        {
            // a serializer
            OutputFormat outputFormat = new OutputFormat( mXMLDocument, null, true );   //@XERCES
            outputFormat.setEncoding(mEncoding);                                        //@XERCES
            XMLSerializer ser = new XMLSerializer( tXMLWriter, outputFormat );          //@XERCES
            ser.serialize( mXMLDocument );                                              //@XERCES
            return tXMLWriter.toString();
        }
        catch( IOException e )
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.