Examples of XMLOutputFactory


Examples of javax.xml.stream.XMLOutputFactory

{
    private final static String SOAP12 =  "http://www.w3.org/2003/05/soap-envelope";
   
    public static void doXmlOutput(boolean useRepairing) throws XMLStreamException {
        StringWriter buffer = new StringWriter();
        XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
        if (useRepairing) {
            outputFactory.setProperty("javax.xml.stream.isRepairingNamespaces", Boolean.TRUE);
        }
        XMLStreamWriter out = outputFactory.createXMLStreamWriter(buffer);
        out.writeStartDocument();
        out.writeStartElement("env", "Envelope", SOAP12);
        out.writeNamespace("env", SOAP12);
        out.writeNamespace("test", "http://someTestUri");
        out.writeEndElement();
View Full Code Here

Examples of javax.xml.stream.XMLOutputFactory

            Exceptions.printStackTrace(ex);
        }
    }

    private XMLStreamWriter createWriter(StringWriter stringWriter) {
        XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
        outputFactory.setProperty("javax.xml.stream.isRepairingNamespaces", Boolean.FALSE);

        try {
            XMLStreamWriter xmlWriter = outputFactory.createXMLStreamWriter(stringWriter);
            xmlWriter.writeStartDocument("UTF-8", "1.0");
            return xmlWriter;
        } catch (XMLStreamException ex) {
            Exceptions.printStackTrace(ex);
        }
View Full Code Here

Examples of javax.xml.stream.XMLOutputFactory

            zipOut.putNextEntry(new ZipEntry("Project"));
            gephiWriter = new GephiWriter();

            //Create Writer and write project
            XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
            outputFactory.setProperty("javax.xml.stream.isRepairingNamespaces", Boolean.FALSE);
            BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(zipOut);
            XMLStreamWriter writer = outputFactory.createXMLStreamWriter(bufferedOutputStream, "UTF-8");
            gephiWriter.writeAll(project, writer);
            writer.close();

            //Close
            zipOut.closeEntry();
View Full Code Here

Examples of javax.xml.stream.XMLOutputFactory

            }
        }
        Progress.switchToDeterminate(progress, max);

        try {
            XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
            outputFactory.setProperty("javax.xml.stream.isRepairingNamespaces", Boolean.FALSE);

            XMLStreamWriter xmlWriter = outputFactory.createXMLStreamWriter(writer);
            xmlWriter = new IndentingXMLStreamWriter(xmlWriter);

            xmlWriter.writeStartDocument("UTF-8", "1.0");
            xmlWriter.setPrefix("", GEXF_NAMESPACE);
            xmlWriter.writeStartElement(GEXF_NAMESPACE, GEXF);
View Full Code Here

Examples of javax.xml.stream.XMLOutputFactory

            Exceptions.printStackTrace(ex);
        }
    }

    private XMLStreamWriter createWriter(StringWriter stringWriter) {
        XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
        outputFactory.setProperty("javax.xml.stream.isRepairingNamespaces", Boolean.FALSE);

        try {
            XMLStreamWriter xmlWriter = outputFactory.createXMLStreamWriter(stringWriter);
            xmlWriter.writeStartDocument("UTF-8", "1.0");
            return xmlWriter;
        } catch (XMLStreamException ex) {
            Exceptions.printStackTrace(ex);
        }
View Full Code Here

Examples of javax.xml.stream.XMLOutputFactory

            e.printStackTrace();
        }
    }

    private XMLStreamWriter createWriter(StringWriter stringWriter) {
        XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
        outputFactory.setProperty("javax.xml.stream.isRepairingNamespaces", Boolean.FALSE);

        try {
            XMLStreamWriter xmlWriter = outputFactory.createXMLStreamWriter(stringWriter);
            xmlWriter.writeStartDocument("UTF-8", "1.0");
            return xmlWriter;
        } catch (XMLStreamException ex) {
            Exceptions.printStackTrace(ex);
        }
View Full Code Here

Examples of javax.xml.stream.XMLOutputFactory

    Result result = outputResolver.createOutput("", "schema1.xsd");

    XMLStreamWriter out = null;
   
    try {
      XMLOutputFactory factory = getXMLOutputFactory();
      out = factory.createXMLStreamWriter(result);

      out.writeStartDocument("UTF-8", "1.0");

      out.writeStartElement("xsd", "schema", XML_SCHEMA_NS);
      out.writeAttribute("version", "1.0");
View Full Code Here

Examples of javax.xml.stream.XMLOutputFactory

      return property.read(u, in, null);
    }
    else {
      DOMResult result = new DOMResult();
      XMLOutputFactory factory = _context.getXMLOutputFactory();
      XMLStreamWriter out = factory.createXMLStreamWriter(result);

      StaxUtil.copyReaderToWriter(in, out);

      Node node = result.getNode();
View Full Code Here

Examples of javax.xml.stream.XMLOutputFactory

    class EventWriterProcessor implements OutputProcessor {

        private XMLEventWriter xmlEventWriter;

        EventWriterProcessor(Writer writer) throws Exception {
            XMLOutputFactory xmlOutputFactory = XMLOutputFactory.newInstance();
            xmlEventWriter = xmlOutputFactory.createXMLEventWriter(writer);
        }
View Full Code Here

Examples of javax.xml.stream.XMLOutputFactory

            return;
        }
        Object fault = faultMethod.invoke(ex);

        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
        XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
        outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);

        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
        writer.write(fault, faultPart, evtWriter);
        LOG.log(Level.INFO, "Found exception in the raises list.  Marshalling.");
        ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
        XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);
        CorbaObjectHandler obj = corbaStaxObject.readObjectFromStax(evtReader, exIdlType);
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.