Search in sources :

Example 1 with NamespaceContextPreservationFilterHandler

use of org.apache.axiom.om.impl.stream.NamespaceContextPreservationFilterHandler in project webservices-axiom by apache.

the class XMLReaderImpl method parse.

private void parse() throws SAXException {
    XmlHandler handler = new ContentHandlerXmlHandler(contentHandler, lexicalHandler);
    CoreElement contextElement = root.getContextElement();
    if (contextElement != null) {
        handler = new NamespaceContextPreservationFilterHandler(handler, contextElement);
    }
    try {
        root.internalSerialize(handler, cache);
    } catch (CoreModelException ex) {
        throw new SAXException(ex);
    } catch (StreamException ex) {
        Throwable cause = ex.getCause();
        if (cause instanceof SAXException) {
            throw (SAXException) cause;
        } else if (cause instanceof Exception) {
            throw new SAXException((Exception) cause);
        } else {
            throw new SAXException(ex);
        }
    }
}
Also used : CoreElement(org.apache.axiom.core.CoreElement) NamespaceContextPreservationFilterHandler(org.apache.axiom.om.impl.stream.NamespaceContextPreservationFilterHandler) ContentHandlerXmlHandler(org.apache.axiom.core.stream.sax.ContentHandlerXmlHandler) XmlHandler(org.apache.axiom.core.stream.XmlHandler) CoreModelException(org.apache.axiom.core.CoreModelException) ContentHandlerXmlHandler(org.apache.axiom.core.stream.sax.ContentHandlerXmlHandler) StreamException(org.apache.axiom.core.stream.StreamException) CoreModelException(org.apache.axiom.core.CoreModelException) SAXException(org.xml.sax.SAXException) IOException(java.io.IOException) SAXException(org.xml.sax.SAXException) StreamException(org.apache.axiom.core.stream.StreamException)

Aggregations

IOException (java.io.IOException)1 CoreElement (org.apache.axiom.core.CoreElement)1 CoreModelException (org.apache.axiom.core.CoreModelException)1 StreamException (org.apache.axiom.core.stream.StreamException)1 XmlHandler (org.apache.axiom.core.stream.XmlHandler)1 ContentHandlerXmlHandler (org.apache.axiom.core.stream.sax.ContentHandlerXmlHandler)1 NamespaceContextPreservationFilterHandler (org.apache.axiom.om.impl.stream.NamespaceContextPreservationFilterHandler)1 SAXException (org.xml.sax.SAXException)1