Package org.codehaus.stax2

Examples of org.codehaus.stax2.XMLStreamWriter2.writeEndDocument()


            // and ditto for empty element:
            sw = getDTDValidatingWriter(strw, REQUIRED_DTD_STR, nsAware, repairing);
            sw.writeEmptyElement("root");
            sw.writeAttribute("reqAttr", "hii & haa");
            sw.writeEndDocument();
            sw.close();
        }
    }

    public void testInvalidRequiredAttr()
View Full Code Here


                sw.writeNamespace(NS_PREFIX, NS_URI);
            }
            // prefix, uri, localname (for attrs!)
            sw.writeAttribute(NS_PREFIX, NS_URI, "attr", "value");
            sw.writeEndElement();
            sw.writeEndDocument();
            sw.close();
        }
    }

    public void testInvalidNsAttr()
View Full Code Here

      // all the sbml element namespaces are registered to the writer in the writeAnnotation method

      // call the writeAnnotation, indicating that we are building an xml fragment
      writeAnnotation(sbase, outputDocument, writer, 0, true);

      writer.writeEndDocument();
      writer.close();

      annotationStr = stream.toString();
    } catch (XMLStreamException e) {
      e.printStackTrace();
View Full Code Here

        sw.writeStartDocument();
        for (Node child = doc.getFirstChild(); child != null; child = child.getNextSibling()) {
            _writeNode(sw, child);
        }
        sw.writeEndDocument();
        sw.close();
    }

    public void writeFragment(NodeList nodes, XMLStreamWriter sw0)
        throws XMLStreamException
View Full Code Here

      // all the sbml element namespaces are registered to the writer in the writeAnnotation method

      // call the writeAnnotation, indicating that we are building an xml fragment
      writeAnnotation(sbase, outputDocument, writer, 0, true);

      writer.writeEndDocument();
      writer.close();

      annotationStr = stream.toString();
    } catch (XMLStreamException e) {
      e.printStackTrace();
View Full Code Here

      // all the sbml element namespaces are registered to the writer in the writeAnnotation method

      // call the writeAnnotation, indicating that we are building an xml fragment
      writeAnnotation(sbase, outputDocument, writer, 0, true);

      writer.writeEndDocument();
      writer.close();

      annotationStr = stream.toString();
    } catch (XMLStreamException e) {
      e.printStackTrace();
View Full Code Here

        */

        sw.writeStartDocument();
        sw.writeSpace("\n");
        writeContents(sw);
        sw.writeEndDocument();

        sw.flush();
        sw.close();

        System.err.println("DOC -> '"+new String(bos.toByteArray(), ENCODING)+"'");
View Full Code Here

        sw.writeStartDocument();
        sw.writeStartElement("root");
        sw.writeIntAttribute(null, null, "attr", -900);
        sw.writeInt(123);
        sw.writeEndElement();
        sw.writeEndDocument();
        sw.close();

        Element root = doc.getDocumentElement();

        assertNotNull(root);
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.