/** * Factory method to make the StyleNodeFactory, used for constructing elements * in a stylesheet document * * @param compilation the compilation episode (compiling one package) * @return the StyleNodeFactory used in this Configuration */ public StyleNodeFactory makeStyleNodeFactory(Compilation compilation) { return new StyleNodeFactory(this, compilation); }
/** * Factory method to make the StyleNodeFactory, used for constructing elements * in a stylesheet document * * @param compilation the compilation episode (compiling one package) * @return the StyleNodeFactory used in this Configuration */ public StyleNodeFactory makeStyleNodeFactory(Compilation compilation) { return new StyleNodeFactory(this, compilation); }
/** * Determine at run-time whether a particular instruction is available. Returns true * only in the case of XSLT instructions and Saxon extension instructions; returns false * for user-defined extension instructions * @param uri the namespace URI of the element * @param localname the local part of the element name * @param context the XPath evaluation context * @return true if the instruction is available, in the sense of the XSLT element-available() function */ private boolean isElementAvailable(String uri, String localname, XPathContext context) { // This is horribly inefficient. But hopefully it's hardly ever executed, because there // is very little point calling element-available() with a dynamically-constructed argument. // And the inefficiency is only incurred once, on the first call. // Note: this requires the compile-time classes to be available at run-time; it will need // changing if we ever want to build a run-time JAR file. try { if (styleNodeFactory==null) { Configuration config = context.getConfiguration(); styleNodeFactory = new StyleNodeFactory(config, context.getController().getErrorListener()); } return styleNodeFactory.isElementAvailable(uri, localname); } catch (Exception err) { //err.printStackTrace(); return false; } }
/** * Determine at run-time whether a particular instruction is available. Returns true * only in the case of XSLT instructions and Saxon extension instructions; returns false * for user-defined extension instructions * @param uri the namespace URI of the element * @param localname the local part of the element name * @param context the XPath evaluation context * @return true if the instruction is available, in the sense of the XSLT element-available() function */ private boolean isElementAvailable(String uri, String localname, XPathContext context) { // This is horribly inefficient. But hopefully it's hardly ever executed, because there // is very little point calling element-available() with a dynamically-constructed argument. // And the inefficiency is only incurred once, on the first call. // Note: this requires the compile-time classes to be available at run-time; it will need // changing if we ever want to build a run-time JAR file. try { if (styleNodeFactory==null) { Configuration config = context.getConfiguration(); styleNodeFactory = new StyleNodeFactory(config, context.getController().getErrorListener()); } return styleNodeFactory.isElementAvailable(uri, localname); } catch (Exception err) { //err.printStackTrace(); return false; } }
/** * Determine at run-time whether a particular instruction is available. Returns true * only in the case of XSLT instructions and Saxon extension instructions; returns false * for user-defined extension instructions * @param uri the namespace URI of the element * @param localname the local part of the element name * @param context the XPath evaluation context * @return true if the instruction is available, in the sense of the XSLT element-available() function */ private boolean isElementAvailable(String uri, String localname, XPathContext context) { // This is horribly inefficient. But hopefully it's hardly ever executed, because there // is very little point calling element-available() with a dynamically-constructed argument. // And the inefficiency is only incurred once, on the first call. // Note: this requires the compile-time classes to be available at run-time; it will need // changing if we ever want to build a run-time JAR file. try { if (styleNodeFactory==null) { Configuration config = context.getConfiguration(); styleNodeFactory = new StyleNodeFactory(config, context.getController().getErrorListener()); } return styleNodeFactory.isElementAvailable(uri, localname); } catch (Exception err) { //err.printStackTrace(); return false; } }
nodeFactory = new StyleNodeFactory(config, errorListener); DocumentImpl doc; try {
nodeFactory = new StyleNodeFactory(config, errorListener); DocumentImpl doc; try {
/** * Determine if an extension element is available * @throws net.sf.saxon.trans.XPathException if the name is invalid or the prefix is not declared */ public boolean isElementAvailable(String qname) throws XPathException { try { String[] parts = getConfiguration().getNameChecker().getQNameParts(qname); String uri; if (parts[0].length() == 0) { uri = getDefaultElementNamespace(); } else { uri = getURIForPrefix(parts[0]); } if (nodeFactory == null) { Configuration config = getConfiguration(); nodeFactory = new StyleNodeFactory(config, config.getErrorListener()); } return nodeFactory.isElementAvailable(uri, parts[1]); } catch (QNameException e) { XPathException err = new XPathException("Invalid element name. " + e.getMessage()); err.setErrorCode("XTDE1440"); throw err; } }
/** * Determine if an extension element is available * @throws net.sf.saxon.trans.XPathException if the name is invalid or the prefix is not declared */ public boolean isElementAvailable(String qname) throws XPathException { try { String[] parts = getConfiguration().getNameChecker().getQNameParts(qname); String uri; if (parts[0].length() == 0) { uri = getDefaultElementNamespace(); } else { uri = getURIForPrefix(parts[0]); } if (nodeFactory == null) { Configuration config = getConfiguration(); nodeFactory = new StyleNodeFactory(config, config.getErrorListener()); } return nodeFactory.isElementAvailable(uri, parts[1]); } catch (QNameException e) { XPathException err = new XPathException("Invalid element name. " + e.getMessage()); err.setErrorCode("XTDE1440"); throw err; } }
StyleNodeFactory snFactory = new StyleNodeFactory(config, pss.getErrorListener()); includedDoc = pss.loadStylesheetModule(source, snFactory);
StyleNodeFactory snFactory = new StyleNodeFactory(config, getPreparedStylesheet().getErrorListener()); includedDoc = PreparedStylesheet.loadStylesheetModule(source, config, getNamePool(), snFactory);
/** * Create a TemplatesHandlerImpl and initialise variables. The constructor is protected, because * the Filter should be created using newTemplatesHandler() in the SAXTransformerFactory * class * @param config the Saxon configuration */ protected TemplatesHandlerImpl(Configuration config) { setPipelineConfiguration(config.makePipelineConfiguration()); nodeFactory = new StyleNodeFactory(config, getPipelineConfiguration().getErrorListener()); builder = new TreeBuilder(); builder.setPipelineConfiguration(getPipelineConfiguration()); builder.setNodeFactory(nodeFactory); builder.setLineNumbering(true); StartTagBuffer startTagBuffer = new StartTagBuffer(); UseWhenFilter useWhenFilter = new UseWhenFilter(startTagBuffer); useWhenFilter.setUnderlyingReceiver(builder); useWhenFilter.setPipelineConfiguration(getPipelineConfiguration()); startTagBuffer.setUnderlyingReceiver(useWhenFilter); startTagBuffer.setPipelineConfiguration(getPipelineConfiguration()); StylesheetStripper styleStripper = new StylesheetStripper(); styleStripper.setUnderlyingReceiver(startTagBuffer); styleStripper.setPipelineConfiguration(getPipelineConfiguration()); CommentStripper commentStripper = new CommentStripper(); commentStripper.setUnderlyingReceiver(styleStripper); commentStripper.setPipelineConfiguration(getPipelineConfiguration()); setReceiver(commentStripper); }
/** * Create a TemplatesHandlerImpl and initialise variables. The constructor is protected, because * the Filter should be created using newTemplatesHandler() in the SAXTransformerFactory * class * @param config the Saxon configuration */ protected TemplatesHandlerImpl(Configuration config) { setPipelineConfiguration(config.makePipelineConfiguration()); nodeFactory = new StyleNodeFactory(config, getPipelineConfiguration().getErrorListener()); builder = new TreeBuilder(); builder.setPipelineConfiguration(getPipelineConfiguration()); builder.setNodeFactory(nodeFactory); builder.setLineNumbering(true); StartTagBuffer startTagBuffer = new StartTagBuffer(); UseWhenFilter useWhenFilter = new UseWhenFilter(startTagBuffer); useWhenFilter.setUnderlyingReceiver(builder); useWhenFilter.setPipelineConfiguration(getPipelineConfiguration()); startTagBuffer.setUnderlyingReceiver(useWhenFilter); startTagBuffer.setPipelineConfiguration(getPipelineConfiguration()); StylesheetStripper styleStripper = new StylesheetStripper(); styleStripper.setStylesheetRules(config.getNamePool()); styleStripper.setUnderlyingReceiver(startTagBuffer); styleStripper.setPipelineConfiguration(getPipelineConfiguration()); CommentStripper commentStripper = new CommentStripper(); commentStripper.setUnderlyingReceiver(styleStripper); commentStripper.setPipelineConfiguration(getPipelineConfiguration()); setReceiver(commentStripper); }