/** * 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; }
/** * Set the URIResolver to be used in this configuration. This will be used to * resolve the URIs used statically (e.g. by xsl:include) and also the URIs used * dynamically by functions such as document() and doc(). Note that the URIResolver * does not resolve the URI in the sense of RFC 2396 (which is also the sense in which * the resolve-uri() function uses the term): rather it dereferences an absolute URI * to obtain an actual resource, which is returned as a Source object. * @param resolver The URIResolver to be used. * @since 8.4 */ public void setURIResolver(URIResolver resolver) { uriResolver = resolver; if (resolver instanceof StandardURIResolver) { ((StandardURIResolver)resolver).setConfiguration(this); } }
/** * 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); }
Platform platform = getPlatform(); source = getPTreeSource(relativeURI, base); return resolve(href, expandedBase); setSAXInputSource((SAXSource)source, uriString);
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; }
return Boolean.valueOf(getSystemURIResolver().queryParametersAreRecognized());
Platform platform = getPlatform(); source = getPTreeSource(relativeURI, base); return resolve(href, expandedBase); setSAXInputSource((SAXSource)source, uriString);
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; }
return Boolean.valueOf(getSystemURIResolver().queryParametersAreRecognized());
/** * 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; }
sourceInput = config.getURIResolver().resolve(sourceFileName, null); if (sourceInput == null) { sourceInput = config.getSystemURIResolver().resolve(sourceFileName, null);
/** * Set the URIResolver to be used in this configuration. This will be used to * resolve the URIs used statically (e.g. by xsl:include) and also the URIs used * dynamically by functions such as document() and doc(). Note that the URIResolver * does not resolve the URI in the sense of RFC 2396 (which is also the sense in which * the resolve-uri() function uses the term): rather it dereferences an absolute URI * to obtain an actual resource, which is returned as a Source object. * * @param resolver The URIResolver to be used. * @since 8.4 */ public void setURIResolver(URIResolver resolver) { uriResolver = resolver; if (resolver instanceof StandardURIResolver) { ((StandardURIResolver)resolver).setConfiguration(this); } }
/** * 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); }
/** * 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; }
sourceInput = config.getURIResolver().resolve(sourceFileName, null); if (sourceInput == null) { sourceInput = config.getSystemURIResolver().resolve(sourceFileName, null);
/** * Set an object that will be used to resolve URIs used in * document(), etc. * * @param resolver An object that implements the URIResolver interface, or * null. */ public void setURIResolver(URIResolver resolver) { userURIResolver = resolver; if (resolver instanceof StandardURIResolver) { ((StandardURIResolver)resolver).setConfiguration(getConfiguration()); } }
throw new IllegalArgumentException("RECOGNIZE_QUERY_URI_PARAMETERS must be a boolean"); getSystemURIResolver().setRecognizeQueryParameters(((Boolean)value).booleanValue());
styleSource = factory.getURIResolver().resolve(styleFileName, null); if (styleSource == null) { styleSource = factory.getConfiguration().getSystemURIResolver().resolve(styleFileName, null);
/** * Set an object that will be used to resolve URIs used in * document(), etc. * * @param resolver An object that implements the URIResolver interface, or * null. */ public void setURIResolver(URIResolver resolver) { userURIResolver = resolver; if (resolver instanceof StandardURIResolver) { ((StandardURIResolver)resolver).setConfiguration(getConfiguration()); } }
throw new IllegalArgumentException("RECOGNIZE_QUERY_URI_PARAMETERS must be a boolean"); getSystemURIResolver().setRecognizeQueryParameters(((Boolean)value).booleanValue());