public class ResolveURI extends SystemFunction
Constructor and Description |
---|
ResolveURI() |
Modifier and Type | Method and Description |
---|---|
ZeroOrOne<AnyURIValue> |
call(XPathContext context,
Sequence[] arguments)
Evaluate the expression
|
static java.lang.String |
escapeSpaces(java.lang.String s)
Replace spaces by %20
|
static java.net.URI |
makeAbsolute(java.lang.String relativeURI,
java.lang.String base)
Construct an absolute URI from a relative URI and a base URI.
|
static java.lang.String |
tryToExpand(java.lang.String systemId)
If a system ID can't be parsed as a URL, try to expand it as a relative
URI using the current directory as the base URI.
|
static java.lang.String |
unescapeSpaces(java.lang.String uri)
Replace %20 by space
|
dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, exportAttributes, fixArguments, getArity, getCardinality, getCompilerName, getContextNode, getDescription, getDetails, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, getStreamerName, importAttributes, isTrustedResultType, makeCall, makeFunction, makeFunctionCall, makeOptimizedFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, typeCheckCaller
atomize, deepEquals, effectiveBooleanValue, getAnnotations, getStringValue, getStringValueCS, isArray, isMap, makeNewContext, simplify, typeCheck
getLength, head, isStreamed, itemAt, iterate, reduce, subsequence
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLength, head, itemAt, reduce, subsequence
public ZeroOrOne<AnyURIValue> call(XPathContext context, Sequence[] arguments) throws XPathException
context
- the dynamic evaluation contextarguments
- the values of the arguments, supplied as SequenceIteratorsXPathException
- if a dynamic error occurs during the evaluation of the expressionpublic static java.lang.String tryToExpand(java.lang.String systemId)
systemId
- the supplied systemId. Null is treated as equivalent to ""public static java.net.URI makeAbsolute(java.lang.String relativeURI, java.lang.String base) throws java.net.URISyntaxException
new URL(baseURL, relativeURL)
.
Spaces in either URI are converted to %20
If no base URI is available, and the relative URI is not an absolute URI, then the current directory is used as a base URI.
relativeURI
- the relative URI. Null is permitted provided that the base URI is an absolute URIbase
- the base URI. Null is permitted provided that relativeURI is an absolute URIjava.net.URISyntaxException
- if either of the strings is not a valid URI or
if the resolution failspublic static java.lang.String escapeSpaces(java.lang.String s)
s
- the input stringpublic static java.lang.String unescapeSpaces(java.lang.String uri)
uri
- the input uriCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.