Search in sources :

Example 6 with XNIException

use of org.apache.xerces.xni.XNIException in project iaf by ibissource.

the class ValidatorHandlerImpl method endElement.

public void endElement(QName element, Augmentations augs) throws XNIException {
    if (fContentHandler != null) {
        try {
            fTypeInfoProvider.beginEndElement(augs);
            fContentHandler.endElement((element.uri != null) ? element.uri : XMLSymbols.EMPTY_STRING, element.localpart, element.rawname);
        } catch (SAXException e) {
            throw new XNIException(e);
        } finally {
            fTypeInfoProvider.finishEndElement();
        }
    }
}
Also used : XNIException(org.apache.xerces.xni.XNIException) SAXException(org.xml.sax.SAXException)

Example 7 with XNIException

use of org.apache.xerces.xni.XNIException in project iaf by ibissource.

the class ClassLoaderXmlEntityResolver method resolveEntity.

@Override
public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier) throws XNIException, IOException {
    if (log.isDebugEnabled())
        log.debug("resolveEntity publicId [" + resourceIdentifier.getPublicId() + "] baseSystemId [" + resourceIdentifier.getBaseSystemId() + "] expandedSystemId [" + resourceIdentifier.getExpandedSystemId() + "] literalSystemId [" + resourceIdentifier.getLiteralSystemId() + "] namespace [" + resourceIdentifier.getNamespace() + "]");
    if (resourceIdentifier.getBaseSystemId() == null && resourceIdentifier.getExpandedSystemId() == null && resourceIdentifier.getLiteralSystemId() == null && resourceIdentifier.getNamespace() == null && resourceIdentifier.getPublicId() == null) {
        // return null.
        return null;
    }
    String base = resourceIdentifier.getBaseSystemId();
    String href = resourceIdentifier.getLiteralSystemId();
    if (href == null) {
        // Ignore import with namespace but without schemaLocation
        return null;
    }
    Resource resource;
    try {
        resource = resolveToResource(href, base);
    } catch (TransformerException e) {
        throw new XNIException(e);
    }
    return resource.asXMLInputSource();
}
Also used : Resource(nl.nn.adapterframework.core.Resource) TransformerException(javax.xml.transform.TransformerException) XNIException(org.apache.xerces.xni.XNIException)

Aggregations

XNIException (org.apache.xerces.xni.XNIException)7 SAXException (org.xml.sax.SAXException)5 IOException (java.io.IOException)3 SAXParseException (org.xml.sax.SAXParseException)3 XMLInputSource (org.apache.xerces.xni.parser.XMLInputSource)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 PsiFile (com.intellij.psi.PsiFile)1 XmlFile (com.intellij.psi.xml.XmlFile)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 InputStream (java.io.InputStream)1 Reader (java.io.Reader)1 StringReader (java.io.StringReader)1 ConnectException (java.net.ConnectException)1 MalformedURLException (java.net.MalformedURLException)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 URL (java.net.URL)1 UnknownHostException (java.net.UnknownHostException)1 XMLEventReader (javax.xml.stream.XMLEventReader)1