public class DocumentFn extends SystemFunction implements Callable
Constructor and Description |
---|
DocumentFn() |
Modifier and Type | Method and Description |
---|---|
Sequence |
call(XPathContext context,
Sequence[] arguments)
Evaluate the expression
|
static DocumentKey |
computeDocumentKey(java.lang.String href,
java.lang.String baseURI,
PackageData packageData,
boolean strip)
Compute a document key (an absolute URI that can be used to see if a document is already loaded)
|
protected static DocumentKey |
computeDocumentKey(java.lang.String href,
java.lang.String baseURI,
PackageData packageData,
XPathContext c)
Compute a document key
|
int |
getCardinality(Expression[] arguments)
Determine the static cardinality
|
int |
getSpecialProperties(Expression[] arguments)
Get the static properties of this expression (other than its type).
|
static NodeInfo |
makeDoc(java.lang.String href,
java.lang.String baseURI,
PackageData packageData,
ParseOptions options,
XPathContext c,
Location locator,
boolean silent)
Supporting routine to load one external document given a URI (href) and a baseURI.
|
Expression |
makeFunctionCall(Expression... arguments)
Make an expression that either calls this function, or that is equivalent to a call
on this function
|
static NodeInfo |
preLoadDoc(java.lang.String href,
java.lang.String baseURI,
PackageData packageData,
Configuration config,
javax.xml.transform.SourceLocator locator)
Supporting routine to load one external document given a URI (href) and a baseURI.
|
static javax.xml.transform.Source |
resolveURI(java.lang.String href,
java.lang.String baseURI,
java.lang.String documentKey,
XPathContext context)
Call the URIResolver to resolve a URI
|
static void |
sendDoc(java.lang.String href,
java.lang.String baseURI,
PackageData packageData,
XPathContext context,
Location locator,
Receiver out,
ParseOptions parseOptions)
Supporting routine to push one external document given a URI (href) and a baseURI to a given Receiver.
|
static boolean |
sourceIsTree(javax.xml.transform.Source source) |
dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, exportAttributes, fixArguments, getArity, getCompilerName, getContextNode, getDescription, getDetails, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, 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 int getCardinality(Expression[] arguments)
getCardinality
in class SystemFunction
arguments
- the actual arguments suppliedpublic int getSpecialProperties(Expression[] arguments)
getSpecialProperties
in class SystemFunction
arguments
- the expressions supplied as arguments to the function callpublic Expression makeFunctionCall(Expression... arguments)
SystemFunction
makeFunctionCall
in class SystemFunction
arguments
- the supplied arguments to the function callpublic static boolean sourceIsTree(javax.xml.transform.Source source)
public Sequence call(XPathContext context, Sequence[] arguments) throws XPathException
call
in interface Callable
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 NodeInfo makeDoc(java.lang.String href, java.lang.String baseURI, PackageData packageData, ParseOptions options, XPathContext c, Location locator, boolean silent) throws XPathException
href
- the relative URIbaseURI
- the base URIpackageData
- the stylesheet (or other) package in which the call appearsoptions
- parse options to be used. May be null.c
- the dynamic XPath contextlocator
- used to identify the location of the instruction in event of errorsilent
- if true, errors should not be notified to the ErrorListenerEmptySource
;XPathException
- if reading or parsing the document failspublic static javax.xml.transform.Source resolveURI(java.lang.String href, java.lang.String baseURI, java.lang.String documentKey, XPathContext context) throws XPathException
href
- the supplied relative URI, stripped of any fragment identifierbaseURI
- the base URIdocumentKey
- the absolute URI if already available, or null otherwisecontext
- the dynamic contextXPathException
- if the relative URI cannot be resolvedprotected static DocumentKey computeDocumentKey(java.lang.String href, java.lang.String baseURI, PackageData packageData, XPathContext c) throws XPathException
XPathException
public static DocumentKey computeDocumentKey(java.lang.String href, java.lang.String baseURI, PackageData packageData, boolean strip)
href
- the relative URIbaseURI
- the base URIpackageData
- the package in which the call to doc() or document() appears (affects options
such as strip-space)strip
- true if the document is subject to whitespace stripping (typically a source document),
otherwise falsepublic static NodeInfo preLoadDoc(java.lang.String href, java.lang.String baseURI, PackageData packageData, Configuration config, javax.xml.transform.SourceLocator locator) throws XPathException
href
- the relative URI. This must not contain a fragment identifierbaseURI
- the base URIconfig
- the Saxon configurationlocator
- used to identify the location of the instruction in event of error. May be null.XPathException
public static void sendDoc(java.lang.String href, java.lang.String baseURI, PackageData packageData, XPathContext context, Location locator, Receiver out, ParseOptions parseOptions) throws XPathException
href
- the relative URIbaseURI
- the base URIpackageData
- the containing XSLT packagecontext
- the XPath dynamic contextlocator
- used to identify the location of the instruction in case of errorout
- the destination where the document is to be sentXPathException
Copyright (c) 2004-2022 Saxonica Limited. All rights reserved.