Code example for Transformer

Methods: setErrorListener, transform

0
            // illegal input 
            if (transformer == null) {
                throw new XpathException("failed to obtain an XSLT transformer" 
                                         + " for XPath expression."); 
            } 
            transformer.setErrorListener(el);
            transformer.transform(new DOMSource(document), result);
        } catch (javax.xml.transform.TransformerConfigurationException ex) {
            throw new ConfigurationException(ex);
        } 
    } 
 
    /** 
     * Testable method to execute the copy-of transform and return the root 
     * node of the resulting Document. 
     * @param select 
     * @param document 
     * @throws ConfigurationException 
     * @throws TransformerException 
     * @return the root node of the Document created by the copy-of transform. 
     */