Examples of writeEndDocument()


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

                switch (reader.getEventType()) {
                case XMLEvent.START_DOCUMENT:
                    writer.writeStartDocument();
                    break;
                case XMLEvent.END_DOCUMENT:
                    writer.writeEndDocument();
                    break;
                case XMLEvent.START_ELEMENT:
                    writer.writeStartElement(reader.getName().getLocalPart());
                    break;
                case XMLEvent.CHARACTERS:
View Full Code Here

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

                switch (reader.getEventType()) {
                case XMLStreamConstants.START_DOCUMENT:
                    writer.writeStartDocument();
                    break;
                case XMLStreamConstants.END_DOCUMENT:
                    writer.writeEndDocument();
                    break;
                case XMLStreamConstants.START_ELEMENT:
                    writer.writeStartElement(reader.getName().getLocalPart());
                    break;
                case XMLStreamConstants.CHARACTERS:
View Full Code Here

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

        XMLStreamReader reader = inputFactory.createXMLStreamReader(new StreamSource(file.getUrl().toString()));
        String encoding = reader.getEncoding();
        XMLStreamWriter writer = outputFactory.createXMLStreamWriter(out, encoding);
        writer.writeStartDocument(encoding, reader.getVersion());
        serializer.serialize(reader, writer, false);
        writer.writeEndDocument();
        writer.flush();
        XMLAssertEx.assertXMLIdentical(file.getUrl(), new ByteArrayInputStream(out.toByteArray()), false);
    }

    public static TestSuite suite() throws Exception {
View Full Code Here

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

        writer.writeStartElement("child");
        assertEquals("p", writer.getPrefix("urn:ns"));
        writer.writeEndElement();
        assertEquals("p", writer.getPrefix("urn:ns"));
        writer.writeEndElement();
        writer.writeEndDocument();
        writer.close();
    }
}
View Full Code Here

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

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

         // </failureResult>
         writer.writeEndElement();

         // End document
         writer.writeCharacters("\n");
         writer.writeEndDocument();
         writer.flush();
      }
      catch (XMLStreamException e)
      {
         throw new IOException("Exception writing failure response to XML. Failure response message was '" + outcome.getFailureDescription() + "'", e);
View Full Code Here

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

         for (String prop : props)
            sw.writeEmptyElement("D", prop, "DAV:");

         sw.writeEndElement(); // prop
         sw.writeEndElement(); // propfind
         sw.writeEndDocument();
         out.close();
      }
      catch (XMLStreamException e)
      {
         e.printStackTrace();
View Full Code Here

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

            sw.writeEndElement(); // remove
         }

         sw.writeEndElement(); // propertyupdate

         sw.writeEndDocument();
         out.close();
      }
      catch (XMLStreamException e)
      {
         e.printStackTrace();
View Full Code Here

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

         sw.writeStartElement("D", "href", "DAV:");
         sw.writeCharacters("http://exoplatform.org");
         sw.writeEndElement(); // href
         sw.writeEndElement(); // owner
         sw.writeEndElement(); // lockinfo
         sw.writeEndDocument();

      }
      catch (XMLStreamException e)
      {
         e.printStackTrace();
View Full Code Here

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
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.