Examples of writeStartElement()


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

        //sw.writeAttribute("attr", "whatever"); // error!
        sw.writeStartElement(null, "elem");
        sw.writeCharacters("Sub-text");
        sw.writeEndElement();
        //sw.writeStartElement("elem3:foo"); // error, colon inside local name
        sw.writeStartElement("elem3");
        sw.writeEndElement();
        //sw.writeCharacters("Root text <> ]]>\n");
        sw.writeEndElement();
        //sw.writeEmptyElement("secondRoot"); // error!
        sw.writeCharacters("\n"); // white space in epilog
View Full Code Here

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

    private void writeFileContentsAsXML(OutputStream out)
        throws IOException, XMLStreamException
    {
        XMLStreamWriter2 sw = (XMLStreamWriter2) _xmlOutputFactory.createXMLStreamWriter(out);
        sw.writeStartDocument();
        sw.writeStartElement("files");
        byte[] buffer = new byte[4000];
        MessageDigest md;
        try {
            md = MessageDigest.getInstance(DIGEST_TYPE);
        } catch (Exception e) { // no such hash type?
View Full Code Here

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

        } catch (Exception e) { // no such hash type?
            throw new IOException(e);
        }

        for (File f : _downloadableFiles.listFiles()) {
            sw.writeStartElement("file");
            sw.writeAttribute("name", f.getName());
            sw.writeAttribute("checksumType", DIGEST_TYPE);
            FileInputStream fis = new FileInputStream(f);
            int count;
            while ((count = fis.read(buffer)) != -1) {
View Full Code Here

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

                md.update(buffer, 0, count);
                sw.writeBinary(buffer, 0, count);
            }
            fis.close();
            sw.writeEndElement(); // file
            sw.writeStartElement("checksum");
            sw.writeBinaryAttribute("", "", "value", md.digest());
            sw.writeEndElement(); // checksum
        }
        sw.writeEndElement(); // files
        sw.writeEndDocument();
View Full Code Here

Examples of org.codehaus.stax2.typed.TypedXMLStreamWriter.writeStartElement()

        // let's use namespace-aware just because some impls might not support non-ns
        XMLOutputFactory of = getFactory(TYPE_NS);
        TypedXMLStreamWriter sw = (TypedXMLStreamWriter) of.createXMLStreamWriter(new DOMResult(doc));

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

Examples of org.coode.xml.XMLWriter.writeStartElement()

    }

    public void write(Writer writer) throws IOException {
        XMLWriterNamespaceManager nsm = new XMLWriterNamespaceManager("");
        XMLWriter xmlWriter = new XMLWriterImpl(writer, nsm);
        xmlWriter.writeStartElement(PLIST_ELEMENT_NAME);
        xmlWriter.writeStartElement(DICT_ELEMENT_NAME);
        xmlWriter.writeStartElement(KEY_ELEMENT_NAME);
        xmlWriter.writeTextContent(GRAPHICS_LIST);
        xmlWriter.writeEndElement();
        xmlWriter.writeStartElement(ARRAY);
View Full Code Here

Examples of org.coode.xml.XMLWriterImpl.writeStartElement()

    }

    public void write(Writer writer) throws IOException {
        XMLWriterNamespaceManager nsm = new XMLWriterNamespaceManager("");
        XMLWriter xmlWriter = new XMLWriterImpl(writer, nsm);
        xmlWriter.writeStartElement(PLIST_ELEMENT_NAME);
        xmlWriter.writeStartElement(DICT_ELEMENT_NAME);
        xmlWriter.writeStartElement(KEY_ELEMENT_NAME);
        xmlWriter.writeTextContent(GRAPHICS_LIST);
        xmlWriter.writeEndElement();
        xmlWriter.writeStartElement(ARRAY);
View Full Code Here

Examples of org.jvnet.staxex.XMLStreamWriterEx.writeStartElement()

   
    MutableXMLStreamBuffer createBuffer() throws Exception {
        MutableXMLStreamBuffer buffer = new MutableXMLStreamBuffer();
        XMLStreamWriterEx writer = (XMLStreamWriterEx)buffer.createFromXMLStreamWriter();
        writer.writeStartDocument();
        writer.writeStartElement("foo");
        writer.writeBinary(bytes, 0, bytes.length, null);
        writer.writeEndElement();
        writer.writeEndDocument();
       
        assertTrue(buffer.isCreated());
View Full Code Here

Examples of org.serviceconnector.util.XMLDumpWriter.writeStartElement()

        // create file
        FileOutputStream fos = new FileOutputStream(dumpDir + fs + dumpFileName);
        // create xml writer and start dump
        XMLDumpWriter writer = new XMLDumpWriter(fos);
        writer.startDocument();
        writer.writeStartElement("sc-dump");
        writer.writeComment(" *************** APPCONTEXT INFOS ************ ");
        AppContext.dumpAppContextInfos(writer);
        writer.writeComment(" *************** CONFIGURATION *************** ");
        AppContext.getBasicConfiguration().dump(writer);
        writer.writeComment(" *************** RESPONDERS ****************** ");
 
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.