Package org.codehaus.stax2.typed

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


            /* The only obviously invalid cases are using non-declared
             * elements or attributes... so let's test them here (these
             * may be redundant to some degree)
             */
            sw.writeStartElement("root");
            try {
                sw.writeStartElement("unknown");
                fail(modeDesc+" Expected a validation exception when trying to add an undeclared element");
            } catch (XMLValidationException vex) {
                // expected...
View Full Code Here


             * elements or attributes... so let's test them here (these
             * may be redundant to some degree)
             */
            sw.writeStartElement("root");
            try {
                sw.writeStartElement("unknown");
                fail(modeDesc+" Expected a validation exception when trying to add an undeclared element");
            } catch (XMLValidationException vex) {
                // expected...
            }
            sw.close();
View Full Code Here

            }
            sw.close();

            // undecl attr:
            sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
            sw.writeStartElement("root");
            try {
                sw.writeAttribute("unknown", "value");
                fail(modeDesc+" Expected a validation exception when trying to add an undeclared attribute");
            } catch (XMLValidationException vex) {
                // expected...
View Full Code Here

             * output DOCTYPE declaration with specific name...
             */
            XMLStreamWriter2 sw = getDTDValidatingWriter(strw, SIMPLE_DTD, nsAware, repairing);
            sw.writeDTD("root", "http://foo", "public-id", SIMPLE_DTD);
            try {
                sw.writeStartElement("branch");
                fail(modeDesc+" Expected a validation exception when trying to write wrong root element");
            } catch (XMLValidationException vex) {
                // expected...
            }
            // should not continue after exception; state may not be valid
View Full Code Here

            // should not continue after exception; state may not be valid
           
            // And then undeclared root:
            sw = getDTDValidatingWriter(strw, SIMPLE_DTD, nsAware, repairing);
            try {
                sw.writeStartElement("undefined");
                fail(modeDesc+" Expected a validation exception when trying to write an undefined root element");
            } catch (XMLValidationException vex) {
                // expected...
            }
           
View Full Code Here

            boolean nsAware = (i >= 1);
            boolean repairing = (i == 2);

            StringWriter strw = new StringWriter();
            XMLStreamWriter2 sw = getDTDValidatingWriter(strw, SIMPLE_DTD, nsAware, repairing);
            sw.writeStartElement("root");
            sw.writeCharacters("  "); // imitating indentation
            sw.writeStartElement("branch");
            sw.writeEndElement();
            sw.writeStartElement("branch");
            sw.writeCharacters("test");
View Full Code Here

            StringWriter strw = new StringWriter();
            XMLStreamWriter2 sw = getDTDValidatingWriter(strw, SIMPLE_DTD, nsAware, repairing);
            sw.writeStartElement("root");
            sw.writeCharacters("  "); // imitating indentation
            sw.writeStartElement("branch");
            sw.writeEndElement();
            sw.writeStartElement("branch");
            sw.writeCharacters("test");
            sw.writeComment("comment");
            sw.writeEndElement();
View Full Code Here

            XMLStreamWriter2 sw = getDTDValidatingWriter(strw, SIMPLE_DTD, nsAware, repairing);
            sw.writeStartElement("root");
            sw.writeCharacters("  "); // imitating indentation
            sw.writeStartElement("branch");
            sw.writeEndElement();
            sw.writeStartElement("branch");
            sw.writeCharacters("test");
            sw.writeComment("comment");
            sw.writeEndElement();
            sw.writeEmptyElement("branch");
            sw.writeEmptyElement("end");
View Full Code Here

            StringWriter strw = new StringWriter();
           
            // Let's try omitting the end element, first...

            XMLStreamWriter2 sw = getDTDValidatingWriter(strw, SIMPLE_DTD, nsAware, repairing);
            sw.writeStartElement("root");
            sw.writeCharacters("  "); // imitating indentation
            sw.writeStartElement("branch");
            sw.writeEndElement();
            sw.writeStartElement("branch");
            sw.writeCharacters("test");
View Full Code Here

            // Let's try omitting the end element, first...

            XMLStreamWriter2 sw = getDTDValidatingWriter(strw, SIMPLE_DTD, nsAware, repairing);
            sw.writeStartElement("root");
            sw.writeCharacters("  "); // imitating indentation
            sw.writeStartElement("branch");
            sw.writeEndElement();
            sw.writeStartElement("branch");
            sw.writeCharacters("test");
            sw.writeComment("comment");
            sw.writeEndElement();
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.