public class DocumentFn extends SystemFunction
operationargumentEVALUATE_METHOD, EVENT_FEED_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, locationId, PROCESS_METHOD, PUSH_SELECTION, staticProperties, WATCH_METHOD| Constructor and Description |
|---|
DocumentFn() |
| Modifier and Type | Method and Description |
|---|---|
PathMap.PathMapNodeSet |
addToPathMap(PathMap pathMap,
PathMap.PathMapNodeSet pathMapNodeSet)
Add a representation of this expression to a PathMap.
|
void |
checkArguments(ExpressionVisitor visitor)
Method called during static type checking
|
int |
computeCardinality()
Determine the static cardinality
|
static DocumentURI |
computeDocumentKey(java.lang.String href,
java.lang.String baseURI,
javax.xml.transform.URIResolver resolver)
Compute a document key (an absolute URI that can be used to see if a document is already loaded)
|
protected static DocumentURI |
computeDocumentKey(java.lang.String href,
java.lang.String baseURI,
XPathContext c)
Compute a document key
|
int |
computeSpecialProperties()
Get the static properties of this expression (other than its type).
|
Expression |
copy()
Copy an expression.
|
java.lang.String |
getStaticBaseURI()
Get the base URI from the static context
|
SequenceIterator |
iterate(XPathContext context)
iterate() handles evaluation of the function:
it returns a sequence of Document nodes
|
static NodeInfo |
makeDoc(java.lang.String href,
java.lang.String baseURI,
XPathContext c,
javax.xml.transform.SourceLocator locator)
Supporting routine to load one external document given a URI (href) and a baseURI.
|
Expression |
preEvaluate(ExpressionVisitor visitor)
preEvaluate: the document() function can be evaluated at compile time if (a) the argument
is a string literal, and (b) the option
FeatureKeys.PRE_EVALUATE_DOC_FUNCTION is set. |
static NodeInfo |
preLoadDoc(java.lang.String href,
java.lang.String baseURI,
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,
Controller controller)
Call the URIResolver to resolve a URI
|
static void |
sendDoc(java.lang.String href,
java.lang.String baseURL,
XPathContext c,
javax.xml.transform.SourceLocator locator,
Receiver out)
Supporting routine to push one external document given a URI (href) and a baseURI to a given Receiver.
|
void |
sendDocuments(XPathContext context,
Receiver out)
Copy the documents identified by this expression to a given Receiver.
|
addContextDocumentArgument, addDocToPathMap, getDetails, getErrorCodeForTypeErrors, getImplementationMethod, getItemType, getRequiredType, makeSystemFunction, optimize, setDetails, useContextItemAsDefaultaddExternalFunctionCallToPathMap, checkArgumentCount, equals, explain, getArguments, getDisplayName, getExpressionName, getFunctionName, getNumberOfArguments, hashCode, iterateSubExpressions, promote, replaceSubExpression, setArguments, setFunctionName, simplify, simplifyArguments, toString, typeCheckadoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, evaluatePendingUpdates, explain, getCardinality, getColumnNumber, getColumnNumber, getConstructType, getContainer, getDependencies, getEvaluationMethod, getExecutable, getHostLanguage, getIntrinsicDependencies, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, hasLoopingSubexpression, implementsStaticTypeCheck, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterateEvents, iterateSameFocusSubExpressions, markTailFunctionCalls, process, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setFlattened, setLocationId, staticTypeCheck, suppressValidation, typeErrorpublic void checkArguments(ExpressionVisitor visitor) throws XPathException
checkArguments in class SystemFunctionvisitor - the expression visitorXPathExceptionpublic int computeCardinality()
computeCardinality in class SystemFunctionStaticProperty.ALLOWS_ZERO_OR_ONE,
StaticProperty.EXACTLY_ONE, StaticProperty.ALLOWS_ONE_OR_MORE,
StaticProperty.ALLOWS_ZERO_OR_MOREpublic java.lang.String getStaticBaseURI()
public int computeSpecialProperties()
computeSpecialProperties in class SystemFunctionpublic Expression preEvaluate(ExpressionVisitor visitor)
FeatureKeys.PRE_EVALUATE_DOC_FUNCTION is set.preEvaluate in class FunctionCallvisitor - an expression visitorpublic PathMap.PathMapNodeSet addToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet)
addToPathMap in class ExpressionpathMap - the PathMap to which the expression should be addedpathMapNodeSet - the set of nodes in the path map that are affectedpublic Expression copy()
copy in class SystemFunctionpublic SequenceIterator iterate(XPathContext context) throws XPathException
iterate in interface SequenceIterableiterate in class Expressioncontext - supplies the context for evaluationXPathException - if any dynamic error occurs evaluating the
expressionpublic static NodeInfo makeDoc(java.lang.String href, java.lang.String baseURI, XPathContext c, javax.xml.transform.SourceLocator locator) throws XPathException
href - the relative URIbaseURI - the base URIc - the dynamic XPath contextlocator - used to identify the location of the instruction in event of errorXPathExceptionpublic static javax.xml.transform.Source resolveURI(java.lang.String href,
java.lang.String baseURI,
java.lang.String documentKey,
Controller controller)
throws XPathException
href - the supplied relative URI, stripped of any fragment identifierbaseURI - the base URIdocumentKey - the absolute URI if already available, or null otherwisecontroller - the Saxon controllerXPathExceptionprotected static DocumentURI computeDocumentKey(java.lang.String href, java.lang.String baseURI, XPathContext c) throws XPathException
XPathExceptionpublic static DocumentURI computeDocumentKey(java.lang.String href, java.lang.String baseURI, javax.xml.transform.URIResolver resolver) throws XPathException
href - the relative URIbaseURI - the base URIresolver - the URIResolverXPathExceptionpublic static NodeInfo preLoadDoc(java.lang.String href, java.lang.String baseURI, 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.XPathExceptionpublic void sendDocuments(XPathContext context, Receiver out) throws XPathException
context - the XPath dynamic contextout - the destination to which the documents will be sentXPathExceptionpublic static void sendDoc(java.lang.String href,
java.lang.String baseURL,
XPathContext c,
javax.xml.transform.SourceLocator locator,
Receiver out)
throws XPathException
href - the relative URIbaseURL - the base URIc - the XPath dynamic contextlocator - used to identify the lcoation of the instruction in case of errorout - the destination where the document is to be sentXPathException