Search in sources :

Example 36 with StreamException

use of org.apache.axiom.core.stream.StreamException in project webservices-axiom by apache.

the class Serializer method startDTD.

public void startDTD(String name, String publicId, String systemId) throws StreamException {
    inDoctype = true;
    try {
        writer.write("<!DOCTYPE ");
        writer.write(name);
        if (publicId != null) {
            writer.write(" PUBLIC \"");
            writer.write(publicId);
            writer.write('\"');
        }
        if (systemId != null) {
            if (publicId == null) {
                writer.write(" SYSTEM \"");
            } else {
                writer.write(" \"");
            }
            writer.write(systemId);
            writer.write('\"');
        }
    } catch (IOException ex) {
        throw new StreamException(ex);
    }
}
Also used : IOException(java.io.IOException) StreamException(org.apache.axiom.core.stream.StreamException)

Example 37 with StreamException

use of org.apache.axiom.core.stream.StreamException in project webservices-axiom by apache.

the class Serializer method startComment.

@Override
public void startComment() throws StreamException {
    closeStartTag();
    try {
        writer.write("<!--");
    } catch (IOException ex) {
        throw new StreamException(ex);
    }
    switchContext(COMMENT);
}
Also used : IOException(java.io.IOException) StreamException(org.apache.axiom.core.stream.StreamException)

Example 38 with StreamException

use of org.apache.axiom.core.stream.StreamException in project webservices-axiom by apache.

the class Serializer method closeStartTag.

/**
     * For the enclosing elements starting tag write out
     * out any attributes followed by ">"
     *
     * @throws StreamException
     */
private void closeStartTag() throws StreamException {
    if (startTagOpen) {
        try {
            writer.write('>');
            switchContext(MIXED_CONTENT);
        } catch (IOException ex) {
            throw new StreamException(ex);
        }
        startTagOpen = false;
    }
}
Also used : IOException(java.io.IOException) StreamException(org.apache.axiom.core.stream.StreamException)

Aggregations

StreamException (org.apache.axiom.core.stream.StreamException)38 IOException (java.io.IOException)23 SAXException (org.xml.sax.SAXException)9 XMLStreamException (javax.xml.stream.XMLStreamException)6 CoreModelException (org.apache.axiom.core.CoreModelException)3 XmlHandler (org.apache.axiom.core.stream.XmlHandler)3 CoreElement (org.apache.axiom.core.CoreElement)2 Serializer (org.apache.axiom.core.stream.serializer.Serializer)2 XmlDeclarationRewriterHandler (org.apache.axiom.om.impl.stream.XmlDeclarationRewriterHandler)2 OutputStream (java.io.OutputStream)1 StringWriter (java.io.StringWriter)1 DataHandler (javax.activation.DataHandler)1 NamespaceContext (javax.xml.namespace.NamespaceContext)1 XMLStreamWriter (javax.xml.stream.XMLStreamWriter)1 CoreAttribute (org.apache.axiom.core.CoreAttribute)1 CoreNamespaceDeclaration (org.apache.axiom.core.CoreNamespaceDeclaration)1 CoreParentNode (org.apache.axiom.core.CoreParentNode)1 CharacterData (org.apache.axiom.core.stream.CharacterData)1 DocumentElementExtractingFilterHandler (org.apache.axiom.core.stream.DocumentElementExtractingFilterHandler)1 NamespaceRepairingFilterHandler (org.apache.axiom.core.stream.NamespaceRepairingFilterHandler)1