Package javax.xml.stream

Examples of javax.xml.stream.XMLStreamWriter.writeEndDocument()


                  String childNodeHref = rootHref + TextUtil.escape(childNode.getPath(), '%', true);
                  writer.writeAttribute(XML_HREF, childNodeHref);
                  writer.writeEndElement();
               }
               writer.writeEndElement();
               writer.writeEndDocument();
            }
            catch (RepositoryException e)
            {
               LOG.error("Error has occured : ", e);
            }
View Full Code Here


        XMLStreamWriter writer = buffer.createFromXMLStreamWriter();
        writer.writeStartDocument();
        writer.writeStartElement("foo");
        writer.writeCharacters("body");
        writer.writeEndElement();
        writer.writeEndDocument();

        assertTrue(buffer.isCreated());

        XMLStreamReader reader = buffer.readAsXMLStreamReader();
        assertEquals(XMLStreamConstants.START_DOCUMENT,reader.getEventType());
View Full Code Here

       
        assertEquals(null, writer.getPrefix("http://ns3"));
        assertEquals(null, writer.getPrefix("http://ns4"));
        assertEquals("", writer.getPrefix("http://default"));
       
        writer.writeEndDocument();

       
        XMLStreamReader reader = buffer.readAsXMLStreamReader();
        assertEquals(XMLStreamConstants.START_DOCUMENT,reader.getEventType());
View Full Code Here

        public void handleMessage(Message message) throws Fault {
            try {
                XMLStreamWriter xtw = message.getContent(XMLStreamWriter.class);
                if (xtw != null) {
                    xtw.writeEndDocument();
                    xtw.flush();
                    xtw.close();
                }
                /*
                if (xtw instanceof StAXDocumentSerializer) {
View Full Code Here

                XMLStreamWriter xtw = message.getContent(XMLStreamWriter.class);
                if (xtw != null) {
                    xtw.writeEndElement();           
                    // Write Envelope end element
                    xtw.writeEndElement();
                    xtw.writeEndDocument();
                   
                    xtw.flush();
                }
            } catch (XMLStreamException e) {
                SoapVersion soapVersion = message.getVersion();
View Full Code Here

        public void handleMessage(Message message) throws Fault {
            try {
                XMLStreamWriter xtw = message.getContent(XMLStreamWriter.class);
                if (xtw != null) {
                    xtw.writeEndDocument();
                    xtw.flush();
                    xtw.close();
                }

                OutputStream os = (OutputStream)message.get(OUTPUT_STREAM_HOLDER);
View Full Code Here

         writer.writeEndElement();
         writer.writeEndElement();
      }

      writer.writeEndElement();
      writer.writeEndDocument();
   }

   /**
    * Import references from xml-file.
    *
 
View Full Code Here

                }
                mc.put(XMLStreamWriter.class.getName(), writer);   
            }
            marshalToWriter(ms, obj, writer, mt);
            if (mc != null) {
                writer.writeEndDocument();
            }
        } else {
            marshalToOutputStream(ms, obj, os, mt);
        }
    }
View Full Code Here

                  new Annotation[]{}, MediaType.APPLICATION_JSON_TYPE,
                  new MetadataMap<String, String>(), is);
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(os);
        StaxUtils.copy(doc, writer);
        writer.writeEndDocument();
        String s2 = os.toString();
        assertTrue(s2.contains("<group>b</group><name>a</name>"));
    }
   
    @Test
View Full Code Here

                }
                mc.put(XMLStreamWriter.class.getName(), writer);   
            }
            marshalToWriter(ms, obj, writer, mt);
            if (mc != null) {
                writer.writeEndDocument();
            }
        } else {
            marshalToOutputStream(ms, obj, os, mt);
        }
    }
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.