/** * Set the URIResolver to a URI resolver that allows query parameters after the URI, * and in the case of Saxon-EE, that inteprets the file extension .ptree */ public void setParameterizedURIResolver() { getSystemURIResolver().setRecognizeQueryParameters(true); }
/** * Set the URIResolver to a URI resolver that allows query parameters after the URI, * and in the case of Saxon-EE, that inteprets the file extension .ptree */ public void setParameterizedURIResolver() { getSystemURIResolver().setRecognizeQueryParameters(true); }
/** * Set the URIResolver to a URI resolver that allows query parameters after the URI, * and in the case of Saxon-SA, that inteprets the file extension .ptree */ public void setParameterizedURIResolver() { getSystemURIResolver().setRecognizeQueryParameters(true); }
/** * Set the URIResolver to a URI resolver that allows query parameters after the URI, * and in the case of Saxon-SA, that inteprets the file extension .ptree */ public void setParameterizedURIResolver() { getSystemURIResolver().setRecognizeQueryParameters(true); }
protected Source processSourceFile(String sourceFileName, boolean useURLs) throws TransformerException { Source sourceInput; if (useURLs || sourceFileName.startsWith("http:") || sourceFileName.startsWith("file:")) { sourceInput = config.getURIResolver().resolve(sourceFileName, null); if (sourceInput == null) { sourceInput = config.getSystemURIResolver().resolve(sourceFileName, null); } } else if (sourceFileName.equals("-")) { // take input from stdin sourceInput = new StreamSource(System.in); } else { File sourceFile = new File(sourceFileName); if (!sourceFile.exists()) { quit("Source file " + sourceFile + " does not exist", 2); } if (Configuration.getPlatform().isJava()) { InputSource eis = new InputSource(sourceFile.toURI().toString()); sourceInput = new SAXSource(eis); } else { sourceInput = new StreamSource(sourceFile.toURI().toString()); } } return sourceInput; }
protected Source processSourceFile(String sourceFileName, boolean useURLs) throws TransformerException { Source sourceInput; if (useURLs || sourceFileName.startsWith("http:") || sourceFileName.startsWith("file:")) { sourceInput = config.getURIResolver().resolve(sourceFileName, null); if (sourceInput == null) { sourceInput = config.getSystemURIResolver().resolve(sourceFileName, null); } } else if (sourceFileName.equals("-")) { // take input from stdin sourceInput = new StreamSource(System.in); } else { File sourceFile = new File(sourceFileName); if (!sourceFile.exists()) { quit("Source file " + sourceFile + " does not exist", 2); } if (Configuration.getPlatform().isJava()) { InputSource eis = new InputSource(sourceFile.toURI().toString()); sourceInput = new SAXSource(eis); } else { sourceInput = new StreamSource(sourceFile.toURI().toString()); } } return sourceInput; }
protected Source processSourceFile(String sourceFileName, boolean useURLs) throws TransformerException { Source sourceInput; if (useURLs || CommandLineOptions.isImplicitURI(sourceFileName)) { sourceInput = config.getURIResolver().resolve(sourceFileName, null); if (sourceInput == null) { sourceInput = config.getSystemURIResolver().resolve(sourceFileName, null); } } else if (sourceFileName.equals("-")) { // take input from stdin sourceInput = new StreamSource(System.in); } else { File sourceFile = new File(sourceFileName); if (!sourceFile.exists()) { quit("Source file " + sourceFile + " does not exist", 2); } if (Version.platform.isJava()) { InputSource eis = new InputSource(sourceFile.toURI().toString()); sourceInput = new SAXSource(eis); } else { sourceInput = new StreamSource(sourceFile.toURI().toString()); } } return sourceInput; }
protected Source processSourceFile(String sourceFileName, boolean useURLs) throws TransformerException { Source sourceInput; if (useURLs || CommandLineOptions.isImplicitURI(sourceFileName)) { sourceInput = config.getURIResolver().resolve(sourceFileName, null); if (sourceInput == null) { sourceInput = config.getSystemURIResolver().resolve(sourceFileName, null); } } else if (sourceFileName.equals("-")) { // take input from stdin sourceInput = new StreamSource(System.in); } else { File sourceFile = new File(sourceFileName); if (!sourceFile.exists()) { quit("Source file " + sourceFile + " does not exist", 2); } if (Version.platform.isJava()) { InputSource eis = new InputSource(sourceFile.toURI().toString()); sourceInput = new SAXSource(eis); } else { sourceInput = new StreamSource(sourceFile.toURI().toString()); } } return sourceInput; }
/** * Return list of stylesheets that matched, as an array of Source objects * @return null if there were no matching stylesheets. * @throws net.sf.saxon.trans.XPathException if a URI cannot be resolved */ public Source[] getAssociatedStylesheets() throws TransformerException { if (stylesheets.size()==0) { return null; } if (uriResolver==null) { uriResolver = new StandardURIResolver(config); } Source[] result = new Source[stylesheets.size()]; for (int i=0; i<stylesheets.size(); i++) { String href = (String)stylesheets.get(i); Source s = uriResolver.resolve(href, baseURI); if (s instanceof SAXSource) { ((SAXSource)s).setXMLReader(config.getStyleParser()); } if (s == null) { s = config.getSystemURIResolver().resolve(href, baseURI); } result[i] = s; } return result; }
/** * Return list of stylesheets that matched, as an array of Source objects * * @return null if there were no matching stylesheets. * @throws net.sf.saxon.trans.XPathException * if a URI cannot be resolved */ /*@Nullable*/ public Source[] getAssociatedStylesheets() throws TransformerException { if (stylesheets.isEmpty()) { return null; } if (uriResolver == null) { uriResolver = new StandardURIResolver(config); } Source[] result = new Source[stylesheets.size()]; for (int i = 0; i < stylesheets.size(); i++) { String href = stylesheets.get(i); Source s = uriResolver.resolve(href, baseURI); if (s instanceof SAXSource) { ((SAXSource) s).setXMLReader(config.getStyleParser()); } if (s == null) { s = config.getSystemURIResolver().resolve(href, baseURI); } result[i] = s; } return result; }
/** * Return list of stylesheets that matched, as an array of Source objects * @return null if there were no matching stylesheets. * @throws net.sf.saxon.trans.XPathException if a URI cannot be resolved */ public Source[] getAssociatedStylesheets() throws TransformerException { if (stylesheets.size()==0) { return null; } if (uriResolver==null) { uriResolver = new StandardURIResolver(config); } Source[] result = new Source[stylesheets.size()]; for (int i=0; i<stylesheets.size(); i++) { String href = (String)stylesheets.get(i); Source s = uriResolver.resolve(href, baseURI); if (s instanceof SAXSource) { ((SAXSource)s).setXMLReader(config.getStyleParser()); } if (s == null) { s = config.getSystemURIResolver().resolve(href, baseURI); } result[i] = s; } return result; }
/** * Return list of stylesheets that matched, as an array of Source objects * @return null if there were no matching stylesheets. * @throws net.sf.saxon.trans.XPathException if a URI cannot be resolved */ public Source[] getAssociatedStylesheets() throws TransformerException { if (stylesheets.size()==0) { return null; } if (uriResolver==null) { uriResolver = new StandardURIResolver(config); } Source[] result = new Source[stylesheets.size()]; for (int i=0; i<stylesheets.size(); i++) { String href = (String)stylesheets.get(i); Source s = uriResolver.resolve(href, baseURI); if (s instanceof SAXSource) { ((SAXSource)s).setXMLReader(config.getStyleParser()); } if (s == null) { s = config.getSystemURIResolver().resolve(href, baseURI); } result[i] = s; } return result; }
/** * Return list of stylesheets that matched, as an array of Source objects * * @return null if there were no matching stylesheets. * @throws net.sf.saxon.trans.XPathException * if a URI cannot be resolved */ /*@Nullable*/ public Source[] getAssociatedStylesheets() throws TransformerException { if (stylesheets.isEmpty()) { return null; } if (uriResolver == null) { uriResolver = new StandardURIResolver(config); } Source[] result = new Source[stylesheets.size()]; for (int i = 0; i < stylesheets.size(); i++) { String href = stylesheets.get(i); Source s = uriResolver.resolve(href, baseURI); if (s instanceof SAXSource) { ((SAXSource) s).setXMLReader(config.getStyleParser()); } if (s == null) { s = config.getSystemURIResolver().resolve(href, baseURI); } result[i] = s; } return result; }
private void resetURIResolver () { Configuration config = compiler.getProcessor().getUnderlyingConfiguration(); config.setURIResolver(new LuxURIResolver(config.getSystemURIResolver(), this, compiler.getUriFieldName())); }
@Override public void inform(SolrCore solrCore) { solrIndexConfig = SolrIndexConfig.registerIndexConfiguration(solrCore); this.core = solrCore; Configuration saxonConfig = solrIndexConfig.getCompiler().getProcessor().getUnderlyingConfiguration(); uriResolver = new SolrURIResolver(this, saxonConfig.getSystemURIResolver()); saxonConfig.setURIResolver(uriResolver); }
source = getConfiguration().getSystemURIResolver().resolve(href, baseUriStr);
source = getConfiguration().getSystemURIResolver().resolve(href, baseUriStr);
/** * Creates an evaluator that uses the provided objects to evaluate queries. * @param compiler queries are compiled using this * @param searcher search operations required by evaluated queries are carried out using this * @param docWriter this writer is used to modify the index (write, delete documents). It must * be tied to the same index as the searcher. */ public Evaluator(Compiler compiler, LuxSearcher searcher, DocWriter docWriter) { this.compiler = compiler; this.searcher = searcher; builder = compiler.getProcessor().newDocumentBuilder(); Configuration config = compiler.getProcessor().getUnderlyingConfiguration(); if (searcher != null) { docReader = new CachingDocReader(builder, config, compiler.getIndexConfiguration()); } else { docReader = null; } this.docWriter = docWriter; queryStats = new QueryStats(); errorListener = new TransformErrorListener(); errorListener.setUserData(this); // TODO: move these out of here; they should be one-time setup for the Processor config.setCollectionURIResolver(new LuxCollectionURIResolver()); config.setOutputURIResolver(new LuxOutputURIResolver()); if (config.getURIResolver() == null || !(config.getURIResolver() instanceof LuxURIResolver)) { config.setURIResolver(new LuxURIResolver(config.getSystemURIResolver(), this, compiler.getIndexConfiguration().getFieldName(FieldRole.URI))); } }
protected void init() { Version.platform.initialize(this); defaultXsltCompilerInfo.setURIResolver(getSystemURIResolver()); StandardEntityResolver resolver = new StandardEntityResolver(); resolver.setConfiguration(this);
protected void init() { Version.platform.initialize(this); defaultXsltCompilerInfo.setURIResolver(getSystemURIResolver()); StandardEntityResolver resolver = new StandardEntityResolver(); resolver.setConfiguration(this);