* @exception TransformerConfigurationException if compilation of the
* stylesheet fails for any reason
*/
protected void prepare(Source styleSource) throws TransformerConfigurationException {
nodeFactory = new StyleNodeFactory(config.getNamePool(), config.isAllowExternalFunctions());
DocumentImpl doc = loadStylesheetModule(styleSource, config, config.getNamePool(), nodeFactory);
setStylesheetDocument(doc, nodeFactory);
if (errorCount > 0) {
throw new TransformerConfigurationException(