public void startDocument(XMLLocator locator, String encoding, NamespaceContext namespaceContext, Augmentations augs) throws XNIException { if (fContentHandler != null) { try { fContentHandler.startDocument(); } catch (SAXException e) { throw new XNIException(e); } } }
public void characters(XMLString text, Augmentations augs) throws XNIException { try { fContentHandler.characters(text.ch,text.offset,text.length); } catch (SAXException e) { throw new XNIException(e); } }
public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException { if (fContentHandler != null) { try { fContentHandler.ignorableWhitespace(text.ch, text.offset, text.length); } catch (SAXException e) { throw new XNIException(e); } } }
public void endElement(QName element, Augmentations augs) throws XNIException { try { fStreamWriter.writeEndElement(); } catch (XMLStreamException e) { throw new XNIException(e); } }
/** Creates an XNIException from a SAXException. NOTE: care should be taken *not* to call this with a SAXParseException; this will lose information!!! */ protected static XNIException createXNIException(SAXException exception) { return new XNIException(exception.getMessage(),exception); } // createXNIException(SAXException):XMLParseException } // class ErrorHandlerWrapper
public void endDocument(Augmentations augs) throws XNIException { try { fContentHandler.endDocument(); } catch (SAXException e) { throw new XNIException(e); } }
public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException { try { fContentHandler.ignorableWhitespace(text.ch,text.offset,text.length); } catch (SAXException e) { throw new XNIException(e); } } }
public void endDocument(Augmentations augs) throws XNIException { if (fContentHandler != null) { try { fContentHandler.endDocument(); } catch (SAXException e) { throw new XNIException(e); } } }
public void characters(XMLString text, Augmentations augs) throws XNIException { if (fContentHandler != null) { // if the type is union it is possible that we receive // a character call with empty data if (text.length == 0) { return; } try { fContentHandler.characters(text.ch, text.offset, text.length); } catch (SAXException e) { throw new XNIException(e); } } }
public void fatalError(String domain, String key, XMLParseException ex) throws XNIException { if (_log.isDebugEnabled()) _log.debug("XSDErrorHandler.fatal: domain=" + domain + ", key=" + key,ex); if (ex != null) { _errors.add(ex); throw ex; } // Should not reach here, but just in case... throw new XNIException("Unknown XSD error state; domain=" + domain + ", key=" +key); } }
/** * @see org.apache.xerces.xni.parser.XMLErrorHandler#error(java.lang.String, java.lang.String, org.apache.xerces.xni.parser.XMLParseException) */ public void error(String domain, String key, XMLParseException ex) throws XNIException { if (_log.isDebugEnabled()) _log.debug("XSDErrorHandler.error: domain=" + domain + ", key=" + key,ex); if (ex != null) { _errors.add(ex); throw ex; } // Should not reach here, but just in case... throw new XNIException("Unknown XSD error state; domain=" + domain + ", key=" +key); }
public void startDocument(XMLLocator locator, String encoding, NamespaceContext namespaceContext, Augmentations augs) throws XNIException { fNamespaceContext = namespaceContext; fContentHandler.setDocumentLocator(new LocatorProxy(locator)); try { fContentHandler.startDocument(); } catch (SAXException e) { throw new XNIException(e); } }
public void handleEndElement(QName element, Augmentations augs) { if (fAssertionProcessor != null) { try { fAssertionProcessor.endElement(element, augs); } catch (Exception ex) { throw new XNIException(ex.getMessage(), ex); } } } // handleEndElement
public void processingInstruction(String target, XMLString data, Augmentations augs) throws XNIException { try { fContentHandler.processingInstruction(target,data.toString()); } catch (SAXException e) { throw new XNIException(e); } }
private void append(Node node) throws XNIException { if (fCurrentNode != null) { fCurrentNode.appendChild(node); } else { /** Check if this node can be attached to the target. */ if ((kidOK[fTarget.getNodeType()] & (1 << node.getNodeType())) == 0) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null); throw new XNIException(msg); } fTargetChildren.add(node); } }
public void endElement(QName element, Augmentations augs) throws XNIException { try { String uri = element.uri != null ? element.uri : ""; String localpart = element.localpart; fContentHandler.endElement(uri, localpart, element.rawname); // send endPrefixMapping events int count = fNamespaceContext.getDeclaredPrefixCount(); if (count > 0) { for (int i = 0; i < count; i++) { fContentHandler.endPrefixMapping(fNamespaceContext.getDeclaredPrefixAt(i)); } } } catch( SAXException e ) { throw new XNIException(e); } }
public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException { if (fContentHandler != null) { try { fTypeInfoProvider.beginStartElement(augs, attributes); fContentHandler.startElement((element.uri != null) ? element.uri : XMLSymbols.EMPTY_STRING, element.localpart, element.rawname, fAttrAdapter); } catch (SAXException e) { throw new XNIException(e); } finally { fTypeInfoProvider.finishStartElement(); } } }
/** * Reports an XPointer error */ protected void reportError(String key, Object[] arguments) throws XNIException { /*fErrorReporter.reportError(XPointerMessageFormatter.XPOINTER_DOMAIN, key, arguments, XMLErrorReporter.SEVERITY_ERROR); */ throw new XNIException((fErrorReporter .getMessageFormatter(XPointerMessageFormatter.XPOINTER_DOMAIN)) .formatMessage(fErrorReporter.getLocale(), key, arguments)); }
/** * Reports XPointer Errors * */ private void reportError(String key, Object[] arguments) throws XNIException { /* fXPointerErrorReporter.reportError( XPointerMessageFormatter.XPOINTER_DOMAIN, key, arguments, XMLErrorReporter.SEVERITY_ERROR); */ throw new XNIException((fErrorReporter .getMessageFormatter(XPointerMessageFormatter.XPOINTER_DOMAIN)) .formatMessage(fErrorReporter.getLocale(), key, arguments)); }
public void characters(XMLString text, Augmentations augs) throws XNIException { if (!fIgnoreChars) { try { if (!fInCDATA) { fEventWriter.add(fEventFactory.createCharacters(text.toString())); } else { fEventWriter.add(fEventFactory.createCData(text.toString())); } } catch (XMLStreamException e) { throw new XNIException(e); } } }