public class EncodeForUri extends ScalarSystemFunction
Constructor and Description |
---|
EncodeForUri() |
Modifier and Type | Method and Description |
---|---|
static void |
checkPercentEncoding(java.lang.String uri)
Check that any percent-encoding within a URI is well-formed.
|
static StringValue |
escape(UnicodeString s,
java.lang.String allowedPunctuation)
Escape special characters in a URI.
|
static void |
escapeChar(int cp,
UnicodeBuilder sb)
Escape a single character in %HH representation, or a pair of two chars representing
a surrogate pair
|
AtomicValue |
evaluate(Item arg,
XPathContext context)
Abstract method that must be supplied in subclasses to perform the evaluation
|
Sequence |
resultWhenEmpty()
Method that may be supplied in subclasses, to indicate the result that is returned
when an empty sequence is supplied as the argument value.
|
call, makeFunctionCall
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, getUniStringArg, hashCode, importAttributes, isSequenceVariadic, isTrustedResultType, makeCall, makeFunction, makeOptimizedFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, toShortString, toString, typeCheckCaller
atomize, deepEquals, effectiveBooleanValue, getAnnotations, getUnicodeStringValue, isArray, isMap, makeNewContext, simplify, typeCheck
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getLength, getStringValue, head, isStreamed, itemAt, iterate, reduce, subsequence
asIterable, concatenate, containsNode, materialize
makeRepeatable
public AtomicValue evaluate(Item arg, XPathContext context) throws XPathException
ScalarSystemFunction
evaluate
in class ScalarSystemFunction
arg
- the supplied argumentcontext
- the dynamic contextXPathException
- if a dynamic error occurspublic Sequence resultWhenEmpty()
ScalarSystemFunction
resultWhenEmpty
in class ScalarSystemFunction
public static StringValue escape(UnicodeString s, java.lang.String allowedPunctuation)
s
- the URI to be escapedallowedPunctuation
- ASCII characters other than letters and digits that
should NOT be %HH-encodedpublic static void escapeChar(int cp, UnicodeBuilder sb)
cp
- the codepoint to be escaped,sb
- the buffer to contain the escaped resultpublic static void checkPercentEncoding(java.lang.String uri) throws XPathException
uri
- the string to be checked for validityXPathException
- if the string is not validly percent-encodedCopyright (c) 2004-2022 Saxonica Limited. All rights reserved.