protected Transformer _newTransformer ( ) { Transformer transformer = null ; if ( _stylesheet == null ) { try { transformer = TransformerFactory . newInstance ( ) . newTransformer ( ) ; } catch ( Exception ex ) { throw new XmlException ( ex ) ; } return transformer ; } if ( _templates == null ) { _templates = _getTemplates ( _stylesheet ) ; } try { transformer = _templates . newTransformer ( ) ; //throws TransformerConfigurationException if ( _params . size ( ) > 0 ) { for ( String name : _params . keySet ( ) ) { Object value = _params . get ( name ) ; transformer . setParameter ( name , value ) ; } } } catch ( Exception ex ) { throw new XmlException ( ex ) ; } return transformer ; }
Creates a new JAXP Transformer . If there are parameters specified they are passed to the Transformer .