Package org.codehaus.stax2

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


            /* Information might not have come from an advanced implementation
             * however?
             */
            if (mRootName != null) {
                XMLStreamWriter2 sw2 = (XMLStreamWriter2) w;
                sw2.writeDTD(mRootName, mSystemId, mPublicId, mInternalSubset);
                return;
            }
        }

        // Nah, just need to do a "dumb" write...
View Full Code Here


           
            /* Ok; can test for "wrong" root element only if we explicitly
             * 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...
View Full Code Here

                // expected...
            }
           
            // and same for explicitly empty element; wrong root
            sw = getDTDValidatingWriter(strw, SIMPLE_DTD, nsAware, repairing);
            sw.writeDTD("root", "http://foo", "public-id", SIMPLE_DTD);
            try {
                sw.writeEmptyElement("branch");
                fail(modeDesc+" Expected a validation exception when trying to write wrong root element");
            } catch (XMLValidationException vex) {
                // expected...
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.