Examples of createXMLEventWriter()


Examples of de.odysseus.staxon.json.JsonXMLOutputFactory.createXMLEventWriter()

    StringReader input = new StringReader("<alice><bob>charlie</bob></alice>");
    StringWriter output = new StringWriter();
    XMLEventReader reader = XMLInputFactory.newFactory().createXMLEventReader(input);
    XMLOutputFactory factory = new JsonXMLOutputFactory();
    factory.setProperty(JsonXMLOutputFactory.PROP_MULTIPLE_PI, true);
    XMLEventWriter writer = factory.createXMLEventWriter(output);
    writer = new XMLMultipleEventWriter(writer, true, "/alice/bob");
    writer.add(reader);
    writer.close();
    Assert.assertEquals("{\"alice\":{\"bob\":[\"charlie\"]}}", output.toString());
  }
View Full Code Here

Examples of javax.xml.stream.XMLOutputFactory.createXMLEventWriter()

      @Override
      public void translate(Writer writer) throws TransformerException,
          IOException {
        try {
          XMLOutputFactory factory = getOutputFactory();
          XMLEventWriter eventWriter = factory.createXMLEventWriter(writer);
          XMLEventFactory eventFactory = XMLEventFactory.newInstance();
          for (Evaluator.NameValuePair nameValuePair : values) {
            if (nameValuePair.value == null) {
              continue;
            }
View Full Code Here

Examples of javax.xml.stream.XMLOutputFactory.createXMLEventWriter()

      @Override
      public void translate(Writer writer) throws TransformerException,
          IOException {
        try {
          XMLOutputFactory factory = getOutputFactory();
          XMLEventWriter eventWriter = factory.createXMLEventWriter(writer);
          XMLEventFactory eventFactory = XMLEventFactory.newInstance();
          addElement(name, writer, eventWriter, eventFactory, namespaces, attributes, contents);
          eventWriter.close();
        } catch (XMLStreamException e) {
          throw new TransformerException(e);
View Full Code Here

Examples of javax.xml.stream.XMLOutputFactory.createXMLEventWriter()

        private XMLEventWriter xmlEventWriter;

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

        @Override
        public void setXMLSecurityProperties(XMLSecurityProperties xmlSecurityProperties) {
        }
View Full Code Here

Examples of javax.xml.stream.XMLOutputFactory.createXMLEventWriter()

        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

Examples of javax.xml.stream.XMLOutputFactory.createXMLEventWriter()

                XMLInputFactory inputFactory = getXMLInputFactory();
                XMLOutputFactory outputFactory = getXMLOutputFactory();
               
                ByteArrayOutputStream outStream = new ByteArrayOutputStream();
                XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
                corbaStaxObject.writeObjectToStax(exStreamable.getObject(),
                                                  evtWriter,
                                                  XMLEventFactory.newInstance());
                evtWriter.flush();
                ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
View Full Code Here

Examples of javax.xml.stream.XMLOutputFactory.createXMLEventWriter()

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

            ByteArrayOutputStream outStream = new ByteArrayOutputStream();
            XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
            CorbaStreamable retVal = outMessage.getStreamableReturn();
            corbaStaxObject.writeObjectToStax(retVal.getObject(), evtWriter,
                                              XMLEventFactory.newInstance());
            evtWriter.flush();
            ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
View Full Code Here

Examples of javax.xml.stream.XMLOutputFactory.createXMLEventWriter()

            if (!skipRead) {
                XMLInputFactory inputFactory = getXMLInputFactory();
                XMLOutputFactory outputFactory = getXMLOutputFactory();
               
                ByteArrayOutputStream outStream = new ByteArrayOutputStream();
                XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
                corbaStaxObject.writeObjectToStax(streamables[i].getObject(),
                                                  evtWriter,
                                                  XMLEventFactory.newInstance());
                evtWriter.flush();
                ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
View Full Code Here

Examples of javax.xml.stream.XMLOutputFactory.createXMLEventWriter()

        outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
     
        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        XMLEventWriter evtWriter = null;
        try {
            evtWriter = outputFactory.createXMLEventWriter(outStream);
        } catch (XMLStreamException ex) {
        }
        assertNotNull(evtWriter);
       
        try {
View Full Code Here

Examples of javax.xml.stream.XMLOutputFactory.createXMLEventWriter()

        outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
     
        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        XMLEventWriter evtWriter = null;
        try {
            evtWriter = outputFactory.createXMLEventWriter(outStream);
        } catch (XMLStreamException ex) {
        }
        assertNotNull(evtWriter);
       
        try {
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.