Package org.codehaus.stax2.typed

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


        sw.writeStartElement(URI3, "leaf");
        sw.writeAttribute(URI2, "ns-attr", "1");
        sw.writeAttribute(null, "ns-attr", "2");
        sw.writeAttribute("otherprefix", URI2, "lastAttr", "x");
        sw.writeEndElement();
        sw.writeEndElement();
        sw.writeCharacters("\n"); // to add lf for terminal output
        sw.writeEndDocument();

        sw.flush();
        sw.close();
View Full Code Here


            // Should be fine now
            sw.writeCharacters("Text that should be ok");
            sw.writeStartElement("branch");
            // Also, all-whitespace is ok in non-mixed too
            sw.writeCharacters("\t \t   \r   \n");
            sw.writeEndElement();
            sw.writeEndElement();
            sw.writeEndDocument();
        }
    }
View Full Code Here

            sw.writeCharacters("Text that should be ok");
            sw.writeStartElement("branch");
            // Also, all-whitespace is ok in non-mixed too
            sw.writeCharacters("\t \t   \r   \n");
            sw.writeEndElement();
            sw.writeEndElement();
            sw.writeEndDocument();
        }
    }

    public void testInvalidMixedContent()
View Full Code Here

            XMLStreamWriter2 sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);

            sw.writeStartElement("root");
            // No content whatsoever is allowed...
            sw.writeEndElement();
            sw.writeEndDocument();
            sw.close();

            // Next; same but with an attribute
            sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
View Full Code Here

            sw.writeStartElement("root");
            // no content, but attribute is fine
            sw.writeAttribute("attr", "value");

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

            // And then using empty element write method(s)
            sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
View Full Code Here

            // 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();

            // Then one with no content
View Full Code Here

            XMLStreamWriter2 sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
            sw.writeStartElement("root");
            sw.writeStartElement("leaf");
            sw.writeCharacters("whatever");
            sw.writeEndElement();
            sw.writeEndElement();
            sw.writeEndDocument();
            sw.close();

            // Then one with no content
            sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
View Full Code Here

            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
            sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
View Full Code Here

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

            // Then one with an attribute
            sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
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.