Package javax.xml.stream

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


        xmlSecurityStreamWriter.writeCData("Hi");
        stdXmlStreamWriter.writeCData("Hi");

        xmlSecurityStreamWriter.writeComment("this is a comment");
        stdXmlStreamWriter.writeComment("this is a comment");

        xmlSecurityStreamWriter.writeCharacters("abcdcba".toCharArray(), 3, 1);
        stdXmlStreamWriter.writeCharacters("abcdcba".toCharArray(), 3, 1);

        xmlSecurityStreamWriter.writeEntityRef("x0");
View Full Code Here


                    break;
                case XMLStreamConstants.CHARACTERS:
                    wrt.writeCharacters(rdr.getText());
                    break;
                case XMLStreamConstants.COMMENT:
                    wrt.writeComment(rdr.getText());
                    break;
                case XMLStreamConstants.DTD:
                    wrt.writeDTD(rdr.getText());
                    break;
                case XMLStreamConstants.END_DOCUMENT:
View Full Code Here

   public void testStreamWriter() throws Exception
   {
      ByteArrayOutputStream stream = new ByteArrayOutputStream();
      XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(stream);
      writer.writeStartDocument();
      writer.writeComment("hello");
      writer.writeStartElement("root");
      writer.writeAttribute("some-attribute", "10");
      writer.close();
      assertEquals("<?xml version='1.0' encoding='UTF-8'?><!--hello--><root some-attribute=\"10\"></root>", stream.toString());
   }
View Full Code Here

                copyStartElement(parser, writer);
                level++;
            } else if (event == XMLStreamReader.CHARACTERS) {
                writer.writeCharacters(parser.getText());
            } else if (event == XMLStreamReader.COMMENT) {
                writer.writeComment(parser.getText());
            } else if (event == XMLStreamReader.CDATA) {
                writer.writeCData(parser.getText());
            } else if (event == XMLStreamReader.END_ELEMENT) {
                level--;
                if (level == 0) {
View Full Code Here

        xmlSecurityStreamWriter.writeCData("Hi");
        stdXmlStreamWriter.writeCData("Hi");

        xmlSecurityStreamWriter.writeComment("this is a comment");
        stdXmlStreamWriter.writeComment("this is a comment");

        xmlSecurityStreamWriter.writeCharacters("abcdcba".toCharArray(), 3, 1);
        stdXmlStreamWriter.writeCharacters("abcdcba".toCharArray(), 3, 1);

        xmlSecurityStreamWriter.writeEntityRef("x0");
View Full Code Here

                copyStartElement(parser, writer);
                level++;
            } else if (event == XMLStreamReader.CHARACTERS) {
                writer.writeCharacters(parser.getText());
            } else if (event == XMLStreamReader.COMMENT) {
                writer.writeComment(parser.getText());
            } else if (event == XMLStreamReader.CDATA) {
                writer.writeCData(parser.getText());
            } else if (event == XMLStreamReader.END_ELEMENT) {
                level--;
                if (level == 0) {
View Full Code Here

     * @throws XMLStreamException
     * @see #serialize(org.apache.axis2.om.impl.OMOutputImpl)
     */
    public void serialize(OMOutputImpl omOutput) throws XMLStreamException {
        XMLStreamWriter writer = omOutput.getXmlStreamWriter();
        writer.writeComment(this.value);
    }

    /**
     * Serializes the node without caching.
     *
 
View Full Code Here

                copyStartElement(parser, writer);
                level++;
            } else if (event == XMLStreamReader.CHARACTERS) {
                writer.writeCharacters(parser.getText());
            } else if (event == XMLStreamReader.COMMENT) {
                writer.writeComment(parser.getText());
            } else if (event == XMLStreamReader.CDATA) {
                writer.writeCData(parser.getText());
            } else if (event == XMLStreamReader.END_ELEMENT) {
                level--;
                if (level == 0) {
View Full Code Here

                copyStartElement(parser, writer);
                level++;
            } else if (event == XMLStreamReader.CHARACTERS) {
                writer.writeCharacters(parser.getText());
            } else if (event == XMLStreamReader.COMMENT) {
                writer.writeComment(parser.getText());
            } else if (event == XMLStreamReader.CDATA) {
                writer.writeCData(parser.getText());
            } else if (event == XMLStreamReader.END_ELEMENT) {
                level--;
                if (level == 0) {
View Full Code Here

                case XMLStreamReader.CHARACTERS:
                    xsw.writeCharacters(xsr.getText());
                    break;

                case XMLStreamReader.COMMENT:
                    xsw.writeComment(xsr.getText());
                    break;

                case XMLStreamReader.DTD:
                    xsw.writeDTD(xsr.getText());
                    break;
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.