Package org.codehaus.stax2

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


            } catch (XMLValidationException vex) { }
            sw.close();

            // Then CDATA
            sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
            sw.writeStartElement("root");
            try {
                sw.writeCData("foo");
                fail(modeDesc+" Expected a validation exception when trying to add CDATA into EMPTY content model");
            } catch (XMLValidationException vex) { }
            sw.close();
View Full Code Here


            } catch (XMLValidationException vex) { }
            sw.close();

            // Then ENTITY
            sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
            sw.writeStartElement("root");
            try {
                sw.writeEntityRef("amp");
                fail(modeDesc+" Expected a validation exception when trying to add CDATA into EMPTY content model");
            } catch (XMLValidationException vex) { }
            sw.close();
View Full Code Here

            } catch (XMLValidationException vex) { }
            sw.close();

            // Then comment
            sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
            sw.writeStartElement("root");
            try {
                sw.writeComment("comment");
                fail(modeDesc+" Expected a validation exception when trying to add comment into EMPTY content model");
            } catch (XMLValidationException vex) { }
            sw.close();
View Full Code Here

            } catch (XMLValidationException vex) { }
            sw.close();

            // Then proc. instr.
            sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
            sw.writeStartElement("root");
            try {
                sw.writeProcessingInstruction("target", "data");
                fail(modeDesc+" Expected a validation exception when trying to add processing instruction into EMPTY content model");
            } catch (XMLValidationException vex) { }
            sw.close();
View Full Code Here

            boolean repairing = (i == 2);
            StringWriter strw = new StringWriter();

            // First simplest case
            XMLStreamWriter2 sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
            sw.writeStartElement("root");
            sw.writeStartElement("leaf");
            sw.writeCharacters("whatever");
            sw.writeEndElement();
            sw.writeEndElement();
            sw.writeEndDocument();
View Full Code Here

            StringWriter strw = new StringWriter();

            // First simplest case
            XMLStreamWriter2 sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
            sw.writeStartElement("root");
            sw.writeStartElement("leaf");
            sw.writeCharacters("whatever");
            sw.writeEndElement();
            sw.writeEndElement();
            sw.writeEndDocument();
            sw.close();
View Full Code Here

            sw.writeEndDocument();
            sw.close();

            // Then one with no content
            sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
            sw.writeStartElement("root");
            sw.writeEndElement();
            sw.writeEndDocument();
            sw.close();

            // Then one with explicitly empty elem
View Full Code Here

            sw.writeEndDocument();
            sw.close();

            // Then one with explicitly empty elem
            sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
            sw.writeStartElement("root");
            sw.writeEmptyElement("leaf");
            sw.writeEndElement();
            sw.writeEndDocument();
            sw.close();
View Full Code Here

            sw.writeEndDocument();
            sw.close();

            // Then one with an attribute
            sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
            sw.writeStartElement("root");
            sw.writeAttribute("attr", "value");
            sw.writeStartElement("leaf");
            sw.writeEndElement();
            sw.writeEndElement();
            sw.writeEndDocument();
View Full Code Here

            // Then one with an attribute
            sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
            sw.writeStartElement("root");
            sw.writeAttribute("attr", "value");
            sw.writeStartElement("leaf");
            sw.writeEndElement();
            sw.writeEndElement();
            sw.writeEndDocument();
            sw.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.