Package com.saxonica.functions.extfn
Class Parse
- java.lang.Object
-
- net.sf.saxon.functions.AbstractFunction
-
- net.sf.saxon.functions.SystemFunction
-
- com.saxonica.functions.extfn.Parse
-
- All Implemented Interfaces:
Callable
,Function
,GroundedValue
,Item
,Sequence
- Direct Known Subclasses:
ParseHtml
public class Parse extends SystemFunction
This class implements the saxon:parse() extension function, which is specially-recognized by the system because it needs access to parts of the static context
-
-
Constructor Summary
Constructors Constructor Description Parse()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeInfo
call(XPathContext context, Sequence[] arguments)
Evaluate this function call at run-timeprotected void
setXMLReader(Configuration config, ParseOptions source)
Set the XML parser to be used, if different from the default XML parser-
Methods inherited from class net.sf.saxon.functions.SystemFunction
dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, exportAttributes, fixArguments, getArity, getCardinality, getCompilerName, getContextNode, getDescription, getDetails, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, getStreamerName, importAttributes, isTrustedResultType, makeCall, makeFunction, makeFunctionCall, makeOptimizedFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, toShortString, toString, typeCheckCaller
-
Methods inherited from class net.sf.saxon.functions.AbstractFunction
atomize, deepEquals, effectiveBooleanValue, getAnnotations, getStringValue, getStringValueCS, isArray, isMap, makeNewContext, simplify, typeCheck
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materialize
-
Methods inherited from interface net.sf.saxon.om.Item
getLength, head, isStreamed, itemAt, iterate, reduce, subsequence
-
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
-
-
-
Method Detail
-
call
public NodeInfo call(XPathContext context, Sequence[] arguments) throws XPathException
Evaluate this function call at run-time- Parameters:
context
- The XPath dynamic evaluation contextarguments
- The values of the arguments to the function call. Each argument value (which is in general a sequence) is supplied in the form of an iterator over the items in the sequence. If required, the supplied sequence can be materialized by calling, for example,new SequenceExtent(arguments[i])
. If the argument is always a singleton, then the single item may be obtained by callingarguments[i].next()
. The implementation is not obliged to read all the items in eachSequenceIterator
if they are not required to compute the result; but if any SequenceIterator is not read to completion, it is good practice to call its close() method.- Returns:
- an iterator over the results of the function. If the result is a single item, it can be
returned in the form of a
SingletonIterator
. If the result is an empty sequence, the method should returnEmptyIterator.getInstance()
- Throws:
XPathException
- if a dynamic error occurs during evaluation of the function. The Saxon run-time code will add information about the error location.
-
setXMLReader
protected void setXMLReader(Configuration config, ParseOptions source) throws XPathException
Set the XML parser to be used, if different from the default XML parser- Parameters:
config
- the Saxon configurationsource
- the ParseOptions object to be updated with the selected parser- Throws:
XPathException
- if the selected parser cannot be loaded
-
-