public void characters(char[] ch, int start, int length) throws SAXException { super.characters(ch, start, length); try { if (!isCDATA) { writer.writeCharacters(ch, start, length); } } catch (XMLStreamException e) { throw new SAXException(e); } }
public void comment(char[] ch, int start, int length) throws SAXException { super.comment(ch, start, length); try { writer.writeComment(new String(ch, start, length)); } catch (XMLStreamException e) { throw new SAXException(e); } }
public void endCDATA() throws SAXException { try { writer.writeCData(CDATABuffer.toString()); } catch (XMLStreamException e) { throw new SAXException(e); } super.endCDATA(); }
public void fatalError(SAXParseException e) throws SAXException { reportException("FATAL", e); }
public void endDocument() throws SAXException { try { writer.writeEndDocument(); } catch (XMLStreamException e) { throw new SAXException(e); } super.endDocument(); }
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { super.ignorableWhitespace(ch, start, length); try { writer.writeCharacters(ch, start, length); } catch (XMLStreamException e) { throw new SAXException(e); } }
public void startDocument() throws SAXException { super.startDocument(); try { writer.writeStartDocument(); } catch (XMLStreamException e) { throw new SAXException(e); } }
public void endElement(String uri, String localName, String qName) throws SAXException { try { writer.writeEndElement(); } catch (XMLStreamException e) { throw new SAXException(e); } finally { super.endElement(uri, localName, qName); } }
public void processingInstruction(String target, String data) throws SAXException { super.processingInstruction(target, data); try { writer.writeProcessingInstruction(target, data); } catch (XMLStreamException e) { throw new SAXException(e); } }
/** * Used to report a {@link SAXException}to the {@link XMLReporter} * registered with this handler. */ protected void reportException(String type, SAXException e) throws SAXException { if (reporter != null) { try { reporter.report(e.getMessage(), type, e, getCurrentLocation()); } catch (XMLStreamException e1) { throw new SAXException(e1); } } }
public void error(SAXParseException e) throws SAXException { reportException("ERROR", e); }
public void endDocument() throws SAXException { eventFactory.setLocation(getCurrentLocation()); try { consumer.add(eventFactory.createEndDocument()); } catch (XMLStreamException e) { throw new SAXException(e); } super.endDocument(); // clear the namespaces namespaceStack.clear(); }
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { super.ignorableWhitespace(ch, start, length); characters(ch, start, length); }
public void startDocument() throws SAXException { super.startDocument(); // clear the namespaces in case we ended in error before. namespaceStack.clear(); eventFactory.setLocation(getCurrentLocation()); try { consumer.add(eventFactory.createStartDocument()); } catch (XMLStreamException e) { throw new SAXException(e); } }
public void endElement(String uri, String localName, String qName) throws SAXException { super.endElement(uri, localName, qName); eventFactory.setLocation(getCurrentLocation()); // parse name String[] qname = {null, null}; parseQName(qName, qname); // get namespaces Collection nsList = (Collection) namespaceStack.remove(namespaceStack.size() - 1); Iterator nsIter = nsList.iterator(); try { consumer.add(eventFactory.createEndElement(qname[0], uri, qname[1], nsIter)); } catch (XMLStreamException e) { throw new SAXException(e); } }
public void processingInstruction(String target, String data) throws SAXException { super.processingInstruction(target, data); try { consumer.add(eventFactory.createProcessingInstruction(target, data)); } catch (XMLStreamException e) { throw new SAXException(e); } }
public void warning(SAXParseException e) throws SAXException { reportException("WARNING", e); }
public void characters(char[] ch, int start, int length) throws SAXException { super.characters(ch, start, length); try { if (!isCDATA) { eventFactory.setLocation(getCurrentLocation()); consumer.add(eventFactory.createCharacters(new String(ch, start, length))); } } catch (XMLStreamException e) { throw new SAXException(e); } }
public void endCDATA() throws SAXException { eventFactory.setLocation(getCurrentLocation()); try { consumer.add(eventFactory.createCData(CDATABuffer.toString())); } catch (XMLStreamException e) { throw new SAXException(e); } super.endCDATA(); }
public void comment(char[] ch, int start, int length) throws SAXException { super.comment(ch, start, length); eventFactory.setLocation(getCurrentLocation()); try { consumer.add(eventFactory.createComment(new String(ch, start, length))); } catch (XMLStreamException e) { throw new SAXException(e); } }