/** * Get a TransformerHandler object that can process SAX * ContentHandler events into a Result. * * @return TransformerHandler ready to transform SAX events. * * @throws TransformerConfigurationException */ public TransformerHandler newTransformerHandler() throws TransformerConfigurationException { return new TransformerIdentityImpl(m_isSecureProcessing); }
/** * Reset the status of the transformer. */ public void reset() { m_flushedStartDoc = false; m_foundFirstElement = false; m_outputStream = null; clearParameters(); m_result = null; m_resultContentHandler = null; m_resultDeclHandler = null; m_resultDTDHandler = null; m_resultLexicalHandler = null; m_serializer = null; m_systemID = null; m_URIResolver = null; m_outputFormat = new OutputProperties(Method.XML); }
protected final void flushStartDoc() throws SAXException { if(!m_flushedStartDoc) { if (m_resultContentHandler == null) { try { createResultContentHandler(m_result); } catch(TransformerException te) { throw new SAXException(te); } } m_resultContentHandler.startDocument(); m_flushedStartDoc = true; } }
createResultContentHandler(outputTarget); this.startDocument(); try characters(chars, 0, chars.length); this.endDocument();
/** * Receive notification of the end of the document. * * <p>By default, do nothing. Application writers may override this * method in a subclass to take specific actions at the end * of a document (such as finalising a tree or closing an output * file).</p> * * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @see org.xml.sax.ContentHandler#endDocument * * @throws SAXException */ public void endDocument() throws SAXException { flushStartDoc(); m_resultContentHandler.endDocument(); }
createResultContentHandler(outputTarget); this.startDocument(); try characters(chars, 0, chars.length); this.endDocument();
/** * Receive notification of the end of a Namespace mapping. * * <p>By default, do nothing. Application writers may override this * method in a subclass to take specific actions at the end of * each prefix mapping.</p> * * @param prefix The Namespace prefix being declared. * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @see org.xml.sax.ContentHandler#endPrefixMapping * * @throws SAXException */ public void endPrefixMapping(String prefix) throws SAXException { flushStartDoc(); m_resultContentHandler.endPrefixMapping(prefix); }
createResultContentHandler(outputTarget); this.startDocument(); try characters(chars, 0, chars.length); this.endDocument();
/** * Receive notification of the start of a Namespace mapping. * * <p>By default, do nothing. Application writers may override this * method in a subclass to take specific actions at the start of * each Namespace prefix scope (such as storing the prefix mapping).</p> * * @param prefix The Namespace prefix being declared. * @param uri The Namespace URI mapped to the prefix. * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @see org.xml.sax.ContentHandler#startPrefixMapping * * @throws SAXException */ public void startPrefixMapping(String prefix, String uri) throws SAXException { flushStartDoc(); m_resultContentHandler.startPrefixMapping(prefix, uri); }
protected final void flushStartDoc() throws SAXException { if(!m_flushedStartDoc) { if (m_resultContentHandler == null) { try { createResultContentHandler(m_result); } catch(TransformerException te) { throw new SAXException(te); } } m_resultContentHandler.startDocument(); m_flushedStartDoc = true; } }
/** * Get a TransformerHandler object that can process SAX * ContentHandler events into a Result. * * @return TransformerHandler ready to transform SAX events. * * @throws TransformerConfigurationException */ public TransformerHandler newTransformerHandler() throws TransformerConfigurationException { return new TransformerIdentityImpl(m_isSecureProcessing); }
/** * Reset the status of the transformer. */ public void reset() { m_flushedStartDoc = false; m_foundFirstElement = false; m_outputStream = null; clearParameters(); m_result = null; m_resultContentHandler = null; m_resultDeclHandler = null; m_resultDTDHandler = null; m_resultLexicalHandler = null; m_serializer = null; m_systemID = null; m_URIResolver = null; m_outputFormat = new OutputProperties(Method.XML); }
createResultContentHandler(outputTarget); this.startDocument(); try characters(chars, 0, chars.length); this.endDocument();
/** * Receive notification of a skipped entity. * * <p>By default, do nothing. Application writers may override this * method in a subclass to take specific actions for each * processing instruction, such as setting status variables or * invoking other methods.</p> * * @param name The name of the skipped entity. * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @see org.xml.sax.ContentHandler#processingInstruction * * @throws SAXException */ public void skippedEntity(String name) throws SAXException { flushStartDoc(); m_resultContentHandler.skippedEntity(name); }
/** * Receive notification of the beginning of the document. * * <p>By default, do nothing. Application writers may override this * method in a subclass to take specific actions at the beginning * of a document (such as allocating the root node of a tree or * creating an output file).</p> * * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @see org.xml.sax.ContentHandler#startDocument * * @throws SAXException */ public void startDocument() throws SAXException { try { if (null == m_resultContentHandler) createResultContentHandler(m_result); } catch (TransformerException te) { throw new SAXException(te.getMessage(), te); } // Reset for multiple transforms with this transformer. m_flushedStartDoc = false; m_foundFirstElement = false; }
/** * Create a new Transformer object that performs a copy * of the source to the result. * * @return A Transformer object capable of * being used for transformation purposes in a single thread. * * @throws TransformerConfigurationException May throw this during * the parse when it is constructing the * Templates object and it fails. */ public Transformer newTransformer() throws TransformerConfigurationException { return new TransformerIdentityImpl(m_isSecureProcessing); }
/** * Reset the status of the transformer. */ public void reset() { m_flushedStartDoc = false; m_foundFirstElement = false; m_outputStream = null; clearParameters(); m_result = null; m_resultContentHandler = null; m_resultDeclHandler = null; m_resultDTDHandler = null; m_resultLexicalHandler = null; m_serializer = null; m_systemID = null; m_URIResolver = null; m_outputFormat = new OutputProperties(Method.XML); }
createResultContentHandler(outputTarget); this.startDocument(); try characters(chars, 0, chars.length); this.endDocument();
/** * Receive notification of a skipped entity. * * <p>By default, do nothing. Application writers may override this * method in a subclass to take specific actions for each * processing instruction, such as setting status variables or * invoking other methods.</p> * * @param name The name of the skipped entity. * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @see org.xml.sax.ContentHandler#processingInstruction * * @throws SAXException */ public void skippedEntity(String name) throws SAXException { flushStartDoc(); m_resultContentHandler.skippedEntity(name); }
/** * Receive notification of the beginning of the document. * * <p>By default, do nothing. Application writers may override this * method in a subclass to take specific actions at the beginning * of a document (such as allocating the root node of a tree or * creating an output file).</p> * * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @see org.xml.sax.ContentHandler#startDocument * * @throws SAXException */ public void startDocument() throws SAXException { try { if (null == m_resultContentHandler) createResultContentHandler(m_result); } catch (TransformerException te) { throw new SAXException(te.getMessage(), te); } // Reset for multiple transforms with this transformer. m_flushedStartDoc = false; m_foundFirstElement = false; }