public void report(String message, String errorType, Object relatedInformation, Location location) throws XMLStreamException { ExpressionLocation loc = translateLocation(location); XPathException err = new XPathException("Error reported by XML parser: " + message + " (" + errorType + ')'); err.setLocator(loc); try { pipe.getErrorListener().error(err); } catch (TransformerException e) { throw new XMLStreamException(e); } }
public void report(String message, String errorType, Object relatedInformation, Location location) throws XMLStreamException { ExpressionLocation loc = translateLocation(location); XPathException err = new XPathException("Error reported by XML parser: " + message + " (" + errorType + ')'); err.setLocator(loc); try { pipe.getErrorListener().error(err); } catch (TransformerException e) { throw new XMLStreamException(e); } }
public void report(String message, String errorType, Object relatedInformation, Location location) throws XMLStreamException { ExpressionLocation loc = translateLocation(location); XPathException err = new XPathException("Error reported by XML parser: " + message + " (" + errorType + ')'); err.setLocator(loc); try { pipe.getErrorListener().error(err); } catch (TransformerException e) { throw new XMLStreamException(e); } }
public void report(String message, String errorType, Object relatedInformation, Location location) throws XMLStreamException { ExpressionLocation loc = translateLocation(location); XPathException err = new XPathException("Error reported by XML parser: " + message + " (" + errorType + ')'); err.setLocator(loc); try { pipe.getErrorListener().error(err); } catch (TransformerException e) { throw new XMLStreamException(e); } }
public void report(String message, String errorType, Object relatedInformation, Location location) { ExplicitLocation loc = translateLocation(location); XPathException err = new XPathException("Error reported by XML parser: " + message + " (" + errorType + ')'); err.setLocator(loc); pipe.getErrorListener().error(err); }
public void report(String message, String errorType, Object relatedInformation, Location location) { ExplicitLocation loc = translateLocation(location); XPathException err = new XPathException("Error reported by XML parser: " + message + " (" + errorType + ')'); err.setLocator(loc); pipe.getErrorListener().error(err); }
/** * Report the end of an element (the close tag) */ public void endElement(String uri, String localname, String rawname) throws SAXException { //System.err.println("ReceivingContentHandler#End element " + rawname); try { // don't attempt whitespace compression if this end tag follows a start tag flush(!afterStartTag); localLocator.levelInEntity--; receiver.endElement(); } catch (ValidationException err) { err.maybeSetLocation(localLocator); if (!err.hasBeenReported()) { pipe.getErrorListener().fatalError(err); } err.setHasBeenReported(true); throw new SAXException(err); } catch (XPathException err) { err.maybeSetLocation(localLocator); throw new SAXException(err); } afterStartTag = false; }
/** * Report the end of an element (the close tag) */ public void endElement (String uri, String localname, String rawname) throws SAXException { //System.err.println("ReceivingContentHandler#End element " + rawname); try { flush(); receiver.endElement(); } catch (ValidationException err) { err.setLocator(locator); if (!err.hasBeenReported()) { try { pipe.getErrorListener().fatalError(err); } catch (TransformerException e) { // } } err.setHasBeenReported(); throw new SAXException(err); } catch (XPathException err) { throw new SAXException(err); } }
/** * Report the end of an element (the close tag) */ public void endElement (String uri, String localname, String rawname) throws SAXException { //System.err.println("ReceivingContentHandler#End element " + rawname); try { flush(); receiver.endElement(); } catch (ValidationException err) { err.setLocator(locator); if (!err.hasBeenReported()) { try { pipe.getErrorListener().fatalError(err); } catch (TransformerException e) { // } } err.setHasBeenReported(); throw new SAXException(err); } catch (XPathException err) { throw new SAXException(err); } }
/** * Report the end of an element (the close tag) */ public void endElement (String uri, String localname, String rawname) throws SAXException { //System.err.println("ReceivingContentHandler#End element " + rawname); try { flush(); receiver.endElement(); } catch (ValidationException err) { err.maybeSetLocation(ExpressionLocation.makeFromSax(locator)); if (!err.hasBeenReported()) { try { pipe.getErrorListener().fatalError(err); } catch (TransformerException e) { // } } err.setHasBeenReported(); throw new SAXException(err); } catch (XPathException err) { throw new SAXException(err); } }
public void endDocument() throws XPathException { ErrorListener listener = getPipelineConfiguration().getErrorListener(); XPathException de = new XPathException(getWriter().toString()); de.setErrorCode("XTMM9000"); try { if (abort) { listener.error(de); } else { listener.warning(de); } } catch (TransformerException te) { throw XPathException.makeXPathException(te); } }
public void endDocument() throws XPathException { ErrorListener listener = getPipelineConfiguration().getErrorListener(); XPathException de = new XPathException(((StringWriter)getWriter()).toString()); de.setErrorCode("XTMM9000"); try { if (abort) { listener.error(de); } else { listener.warning(de); } } catch (TransformerException te) { throw XPathException.makeXPathException(te); } }
/** * Report the end of an element (the close tag) */ public void endElement(String uri, String localname, String rawname) throws SAXException { //System.err.println("ReceivingContentHandler#End element " + rawname); try { // don't attempt whitespace compression if this end tag follows a start tag flush(!afterStartTag); localLocator.levelInEntity--; receiver.endElement(); } catch (ValidationException err) { err.maybeSetLocation(localLocator); if (!err.hasBeenReported()) { pipe.getErrorListener().fatalError(err); } err.setHasBeenReported(true); throw new SAXException(err); } catch (XPathException err) { err.maybeSetLocation(localLocator); throw new SAXException(err); } afterStartTag = false; }
/** * Receive notification of the beginning of a document. */ public void startDocument() throws SAXException { // System.err.println("ReceivingContentHandler#startDocument"); try { charsUsed = 0; namespacesUsed = 0; receiver.setPipelineConfiguration(pipe); String systemId = localLocator.getSystemId(); if (systemId != null) { receiver.setSystemId(localLocator.getSystemId()); } receiver.open(); receiver.startDocument(0); } catch (QuitParsingException quit) { getPipelineConfiguration().getErrorListener().warning(quit); throw new SAXException(quit); } catch (XPathException err) { throw new SAXException(err); } }
/** * Receive notification of the beginning of a document. */ public void startDocument() throws SAXException { // System.err.println("ReceivingContentHandler#startDocument"); try { charsUsed = 0; namespacesUsed = 0; receiver.setPipelineConfiguration(pipe); String systemId = localLocator.getSystemId(); if (systemId != null) { receiver.setSystemId(localLocator.getSystemId()); } receiver.open(); receiver.startDocument(0); } catch (QuitParsingException quit) { getPipelineConfiguration().getErrorListener().warning(quit); throw new SAXException(quit); } catch (XPathException err) { throw new SAXException(err); } }
public void endDocument() throws XPathException { ErrorListener listener = getPipelineConfiguration().getErrorListener(); XPathException de = new XPathException(getWriter().toString()); if (errorCode != null) { de.setErrorCodeQName(StructuredQName.fromEQName(errorCode)); } else { de.setErrorCode("XTMM9000"); } try { if (abort) { listener.error(de); } else { listener.warning(de); } } catch (TransformerException te) { throw XPathException.makeXPathException(te); } }
public XPathException createXPathException(String message, String errorCode, Location location) { XPathException err = new XPathException(message); err.setErrorCode(errorCode); err.setIsStaticError(true); err.setLocator(location.saveLocation()); getPipelineConfiguration().getErrorListener().fatalError(err); err.setHasBeenReported(true); return err; }
public XPathException createXPathException(String message, String errorCode, Location location) { XPathException err = new XPathException(message); err.setErrorCode(errorCode); err.setIsStaticError(true); err.setLocator(location.saveLocation()); getPipelineConfiguration().getErrorListener().fatalError(err); err.setHasBeenReported(true); return err; }
public void endDocument() throws XPathException { ErrorListener listener = getPipelineConfiguration().getErrorListener(); XPathException de = new XPathException(getWriter().toString()); if (errorCode != null) { de.setErrorCodeQName(StructuredQName.fromEQName(errorCode)); } else { de.setErrorCode("XTMM9000"); } try { if (abort) { listener.error(de); } else { listener.warning(de); } } catch (TransformerException te) { throw XPathException.makeXPathException(te); } }
/** * Create a TemplatesHandlerImpl and initialise variables. The constructor is protected, because * the Filter should be created using newTemplatesHandler() in the SAXTransformerFactory * class * @param config the Saxon configuration */ protected TemplatesHandlerImpl(Configuration config) { setPipelineConfiguration(config.makePipelineConfiguration()); nodeFactory = new StyleNodeFactory(config, getPipelineConfiguration().getErrorListener()); builder = new TreeBuilder(); builder.setPipelineConfiguration(getPipelineConfiguration()); builder.setNodeFactory(nodeFactory); builder.setLineNumbering(true); StartTagBuffer startTagBuffer = new StartTagBuffer(); UseWhenFilter useWhenFilter = new UseWhenFilter(startTagBuffer); useWhenFilter.setUnderlyingReceiver(builder); useWhenFilter.setPipelineConfiguration(getPipelineConfiguration()); startTagBuffer.setUnderlyingReceiver(useWhenFilter); startTagBuffer.setPipelineConfiguration(getPipelineConfiguration()); StylesheetStripper styleStripper = new StylesheetStripper(); styleStripper.setUnderlyingReceiver(startTagBuffer); styleStripper.setPipelineConfiguration(getPipelineConfiguration()); CommentStripper commentStripper = new CommentStripper(); commentStripper.setUnderlyingReceiver(styleStripper); commentStripper.setPipelineConfiguration(getPipelineConfiguration()); setReceiver(commentStripper); }