net.sf.saxon.functions
Class Collection
java.lang.Object
net.sf.saxon.expr.ComputedExpression
net.sf.saxon.expr.FunctionCall
net.sf.saxon.functions.SystemFunction
net.sf.saxon.functions.Collection
- All Implemented Interfaces:
- Container, Expression, InstructionInfoProvider, MappingFunction, java.io.Serializable, javax.xml.transform.SourceLocator
- public class Collection
- extends SystemFunction
- implements MappingFunction
Implement the fn:collection() function. The Saxon implementation loads an XML
document called the collection catalogue, which acts as an index of the collection.
The structure of this index is:
<collection>
<doc href="doc1.xml">
<doc href="doc2.xml">
<doc href="doc3.xml">
</collection>
The document URIs are resolved relative to the base URI of the doc element
in the catalogue document.
- See Also:
- Serialized Form
Methods inherited from class net.sf.saxon.functions.SystemFunction |
addContextDocumentArgument, computeCardinality, computeSpecialProperties, display, getDetails, getItemType, getRequiredType, main, makeSystemFunction, setDetails, useContextItemAsDefault |
Methods inherited from class net.sf.saxon.expr.FunctionCall |
analyze, checkArgumentCount, getDisplayName, getFunctionNameCode, getNumberOfArguments, iterateSubExpressions, promote, setArguments, setFunctionNameCode, simplify, simplifyArguments |
Methods inherited from class net.sf.saxon.expr.ComputedExpression |
adoptChildExpression, checkPermittedContents, computeDependencies, computeStaticProperties, dynamicError, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, getCardinality, getColumnNumber, getConstructType, getDependencies, getExecutable, getImplementationMethod, getInstructionInfo, getIntrinsicDependencies, getLineNumber, getLocationId, getParentExpression, getPublicId, getSpecialProperties, getSystemId, markTailFunctionCalls, process, resetStaticProperties, setLocationId, setParentExpression, typeError, typeError |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Collection
public Collection()
checkArguments
public void checkArguments(StaticContext env)
throws XPathException
- Description copied from class:
SystemFunction
- Method called during static type checking
- Overrides:
checkArguments
in class SystemFunction
- Throws:
XPathException
preEvaluate
public Expression preEvaluate(StaticContext env)
- preEvaluate: this method suppresses compile-time evaluation by doing nothing
- Overrides:
preEvaluate
in class FunctionCall
iterate
public SequenceIterator iterate(XPathContext context)
throws XPathException
- Description copied from class:
ComputedExpression
- Return an Iterator to iterate over the values of a sequence. The value of every
expression can be regarded as a sequence, so this method is supported for all
expressions. This default implementation handles iteration for expressions that
return singleton values: for non-singleton expressions, the subclass must
provide its own implementation.
- Specified by:
iterate
in interface Expression
- Overrides:
iterate
in class ComputedExpression
- Parameters:
context
- supplies the context for evaluation
- Returns:
- a SequenceIterator that can be used to iterate over the result
of the expression
- Throws:
XPathException
- if any dynamic error occurs evaluating the
expression
map
public java.lang.Object map(Item item,
XPathContext context,
java.lang.Object info)
throws XPathException
- Map from doc elements in the catalogue document to nodes
returned in the result
- Specified by:
map
in interface MappingFunction
- Parameters:
item
- A doc element in the catalogue documentcontext
- The dynamic evaluation contextinfo
- not used (set to null)
- Returns:
- the document or element referenced by the @href attribute of the doc
element in the catalogue
- Throws:
XPathException
- if the document cannot be retrieved or parsed, unless
error recovery has been chosen.