public class DocumentFn extends SystemFunctionCall implements Callable
operation
argument
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, locationId, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, 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.
|
Sequence |
call(XPathContext context,
Sequence[] arguments)
Evaluate the expression
|
void |
checkArguments(ExpressionVisitor visitor)
Method called during static type checking
|
int |
computeCardinality()
Determine the static cardinality
|
static DocumentURI |
computeDocumentKey(String href,
String baseURI,
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(String href,
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.
|
boolean |
equals(Object o)
Determine whether two expressions are equivalent
|
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(String href,
String baseURI,
XPathContext c,
SourceLocator locator,
boolean silent)
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(String href,
String baseURI,
Configuration config,
SourceLocator locator)
Supporting routine to load one external document given a URI (href) and a baseURI.
|
static Source |
resolveURI(String href,
String baseURI,
String documentKey,
XPathContext context)
Call the URIResolver to resolve a URI
|
static void |
sendDoc(String href,
String baseURL,
XPathContext c,
SourceLocator locator,
Receiver out,
ParseOptions parseOptions)
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.
|
void |
setStaticBaseURI(String baseURI)
Set the static base URI
|
addContextDocumentArgument, addDocToPathMap, bindStaticContext, equalOrNull, getContextNode, getConvertingCallable, getDefaultArgumentNode, getDetails, getErrorCodeForTypeErrors, getFunctionItemType, getImplementationMethod, getItemType, getOperation, getRequiredType, makeSystemFunction, operands, optimize, setDetails, toShortString, useContextItemAsDefault
addExternalFunctionCallToPathMap, checkArgumentCount, explain, getArguments, getDisplayName, getExpressionName, getFunctionName, getNumberOfArguments, hashCode, promote, replaceOperand, setArguments, setFunctionName, simplifyArguments, toString, typeCheck
adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, clearStreamabilityData, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, evaluatePendingUpdates, explain, getCardinality, getColumnNumber, getConfiguration, getConstructType, getContainer, getDependencies, getEvaluationMethod, getExpressionCompiler, getHostLanguage, getIntegerBounds, getIntrinsicDependencies, getLineNumber, getLocationId, getObjectName, getPosture, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getStreamability, getStreamingAdjunct, getSweep, getSystemId, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isIdentical, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterateEvents, makeStreamingAdjunct, markTailFunctionCalls, operandList, process, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setFlattened, setLocationId, setPostureAndSweep, simplify, staticTypeCheck, suppressValidation, toPattern, toStreamingPattern, typeError, unordered
public void checkArguments(ExpressionVisitor visitor) throws XPathException
checkArguments
in class SystemFunctionCall
visitor
- the expression visitorXPathException
- if the arguments are incorrectpublic int computeCardinality()
computeCardinality
in class SystemFunctionCall
StaticProperty.ALLOWS_ZERO_OR_ONE
,
StaticProperty.EXACTLY_ONE
, StaticProperty.ALLOWS_ONE_OR_MORE
,
StaticProperty.ALLOWS_ZERO_OR_MORE
public String getStaticBaseURI()
public void setStaticBaseURI(String baseURI)
baseURI
- the static base URIpublic int computeSpecialProperties()
computeSpecialProperties
in class SystemFunctionCall
public Expression preEvaluate(ExpressionVisitor visitor)
FeatureKeys.PRE_EVALUATE_DOC_FUNCTION
is set.preEvaluate
in class FunctionCall
visitor
- an expression visitorpublic PathMap.PathMapNodeSet addToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet)
addToPathMap
in class Expression
pathMap
- 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 SystemFunctionCall
public boolean equals(Object o)
equals
in class SystemFunctionCall
public SequenceIterator iterate(XPathContext context) throws XPathException
iterate
in class Expression
context
- supplies the context for evaluationXPathException
- if any dynamic error occurs evaluating the
expressionpublic 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(String href, String baseURI, XPathContext c, SourceLocator locator, boolean silent) throws XPathException
href
- the relative URIbaseURI
- the base URIc
- 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 ErrorListenerXPathException
- if reading or parsing the document failspublic static Source resolveURI(String href, String baseURI, 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
protected static DocumentURI computeDocumentKey(String href, String baseURI, XPathContext c) throws XPathException
XPathException
public static DocumentURI computeDocumentKey(String href, String baseURI, URIResolver resolver) throws XPathException
href
- the relative URIbaseURI
- the base URIresolver
- the URIResolverXPathException
public static NodeInfo preLoadDoc(String href, String baseURI, Configuration config, 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 void sendDocuments(XPathContext context, Receiver out) throws XPathException
context
- the XPath dynamic contextout
- the destination to which the documents will be sentXPathException
public static void sendDoc(String href, String baseURL, XPathContext c, SourceLocator locator, Receiver out, ParseOptions parseOptions) 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
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.