Package de.odysseus.staxon.xml

Examples of de.odysseus.staxon.xml.SimpleXMLStreamWriter.writeStartDocument()


   */
  @Test
  public void testTextContent() throws Exception {
    StringWriter result = new StringWriter();
    XMLStreamWriter writer = new SimpleXMLStreamWriter(result, false);
    writer.writeStartDocument();
    writer.writeStartElement("alice");
    writer.writeCharacters("bob");
    writer.writeEndElement();
    writer.writeEndDocument();
    writer.close();
View Full Code Here


   */
  @Test
  public void testCooment() throws Exception {
    StringWriter result = new StringWriter();
    XMLStreamWriter writer = new SimpleXMLStreamWriter(result, false);
    writer.writeStartDocument();
    writer.writeStartElement("alice");
    writer.writeComment("bob");
    writer.writeEndElement();
    writer.writeEndDocument();
    writer.close();
View Full Code Here

   */
  @Test
  public void testEscapeCharacters() throws Exception {
    StringWriter result = new StringWriter();
    XMLStreamWriter writer = new SimpleXMLStreamWriter(result, false);
    writer.writeStartDocument();
    writer.writeStartElement("alice");
    writer.writeCharacters("<>&\"'");
    writer.writeEndElement();
    writer.writeEndDocument();
    writer.close();
View Full Code Here

   */
  @Test
  public void testEscapeCData() throws Exception {
    StringWriter result = new StringWriter();
    XMLStreamWriter writer = new SimpleXMLStreamWriter(result, false);
    writer.writeStartDocument();
    writer.writeStartElement("alice");
    writer.writeCData("<>&\"'");
    writer.writeEndElement();
    writer.writeEndDocument();
    writer.close();
View Full Code Here

   */
  @Test
  public void testEscapeAttribute() throws Exception {
    StringWriter result = new StringWriter();
    XMLStreamWriter writer = new SimpleXMLStreamWriter(result, false);
    writer.writeStartDocument();
    writer.writeStartElement("alice");
    writer.writeAttribute("escape", "<>&\"'");
    writer.writeEndElement();
    writer.writeEndDocument();
    writer.close();
View Full Code Here

   */
  @Test
  public void testNested() throws Exception {
    StringWriter result = new StringWriter();
    XMLStreamWriter writer = new SimpleXMLStreamWriter(result, false);
    writer.writeStartDocument();
    writer.writeStartElement("alice");
    writer.writeStartElement("bob");
    writer.writeCharacters("charlie");
    writer.writeEndElement();
    writer.writeStartElement("david");
View Full Code Here

   */
  @Test
  public void testArray() throws Exception {
    StringWriter result = new StringWriter();
    XMLStreamWriter writer = new SimpleXMLStreamWriter(result, false);
    writer.writeStartDocument();
    writer.writeStartElement("alice");
    writer.writeStartElement("bob");
    writer.writeCharacters("charlie");
    writer.writeEndElement();
    writer.writeStartElement("bob");
View Full Code Here

   */
  @Test
  public void testAttributes() throws Exception {
    StringWriter result = new StringWriter();
    XMLStreamWriter writer = new SimpleXMLStreamWriter(result, false);
    writer.writeStartDocument();
    writer.writeStartElement("alice");
    writer.writeAttribute("charlie", "david");
    writer.writeCharacters("bob");
    writer.writeEndElement();
    writer.writeEndDocument();
View Full Code Here

  @Test
  public void testNamespaces() throws Exception {
    StringWriter result = new StringWriter();
    XMLStreamWriter writer = new SimpleXMLStreamWriter(result, false);
    writer.setDefaultNamespace("http://some-namespace");
    writer.writeStartDocument();
    writer.writeStartElement("alice");
    writer.writeDefaultNamespace("http://some-namespace");
    writer.writeCharacters("bob");
    writer.writeEndElement();
    writer.writeEndDocument();
View Full Code Here

   */
  @Test
  public void testRepairNamespaces() throws Exception {
    StringWriter result = new StringWriter();
    XMLStreamWriter writer = new SimpleXMLStreamWriter(result, true);
    writer.writeStartDocument();
    writer.writeStartElement("http://some-namespace", "alice");
    writer.writeCharacters("bob");
    writer.writeEndElement();
    writer.writeEndDocument();
    writer.close();
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.