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:
- Expression, MappingFunction, Serializable
- 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:
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.expr.ComputedExpression |
computeDependencies, computeSpecialProperties, computeStaticProperties, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, getCardinality, getDependencies, getIntrinsicDependencies, getLineNumber, getSpecialProperties, markTailFunctionCalls, setLineNumber, 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 Object map(Item item,
XPathContext context,
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.