Package net.sf.saxon.functions
Class DeepEqual
java.lang.Object
net.sf.saxon.expr.ComputedExpression
net.sf.saxon.expr.FunctionCall
net.sf.saxon.functions.SystemFunction
net.sf.saxon.functions.CollatingFunction
net.sf.saxon.functions.DeepEqual
- All Implemented Interfaces:
Serializable
,SourceLocator
,Container
,Expression
,InstructionInfoProvider
XSLT 2.0 deep-equal() function.
Supports deep comparison of two sequences (of nodes and/or atomic values)
optionally using a collation
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Flag indicating that elements and attributes must have the same type annotation to be considered deep-equalstatic final int
Flag indicating that elements and attributes should always be compared according to their string value, not their typed valuestatic final int
Flag indicating that whitespace text nodes are ignored when comparing element nodesstatic final int
Flag indicating that comment children are taken into account when comparing element or document nodesstatic final int
Flag indicating that two elements should only be considered equal if they have the same in-scope namespacesstatic final int
Flag indicating that two element or attribute nodes are considered equal only if their names use the same namespace prefixstatic final int
Flag indicating that processing instruction nodes are taken into account when comparing element or document nodesstatic final int
Flag indicating that adjacent text nodes in the top-level sequence are to be mergedstatic final int
Flag indicating that a warning message explaining the reason why the sequences were deemed non-equal should be sent to the ErrorListenerFields inherited from class net.sf.saxon.functions.CollatingFunction
collation
Fields inherited from class net.sf.saxon.functions.SystemFunction
operation
Fields inherited from class net.sf.saxon.expr.FunctionCall
argument
Fields inherited from class net.sf.saxon.expr.ComputedExpression
locationId, staticProperties
Fields inherited from interface net.sf.saxon.expr.Expression
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
deepEquals
(SequenceIterator op1, SequenceIterator op2, GenericAtomicComparer collator, Configuration config, int flags) Determine when two sequences are deep-equalevaluateItem
(XPathContext context) Evaluate the expressionpreEvaluate
(StaticContext env) preEvaluate: if all arguments are known statically, evaluate earlyMethods inherited from class net.sf.saxon.functions.CollatingFunction
checkArguments, getAtomicComparer, getCollator
Methods inherited from class net.sf.saxon.functions.SystemFunction
addContextDocumentArgument, computeCardinality, computeSpecialProperties, display, getDetails, getErrorCodeForTypeErrors, getItemType, getRequiredType, main, makeSystemFunction, setDetails, useContextItemAsDefault
Methods inherited from class net.sf.saxon.expr.FunctionCall
checkArgumentCount, getArguments, getDisplayName, getFunctionNameCode, getNumberOfArguments, iterateSubExpressions, optimize, promote, replaceSubExpression, setArguments, setFunctionNameCode, simplify, simplifyArguments, typeCheck
Methods inherited from class net.sf.saxon.expr.ComputedExpression
adoptChildExpression, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, getCardinality, getColumnNumber, getConstructType, getDependencies, getExecutable, getHostLanguage, getImplementationMethod, getInstructionInfo, getIntrinsicDependencies, getLineNumber, getLocationId, getLocationProvider, getParentExpression, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasBadParentPointer, iterate, markTailFunctionCalls, process, resetStaticProperties, setLocationId, setParentExpression, setParentExpression, suppressValidation, typeError
-
Field Details
-
INCLUDE_NAMESPACES
public static final int INCLUDE_NAMESPACESFlag indicating that two elements should only be considered equal if they have the same in-scope namespaces- See Also:
-
INCLUDE_PREFIXES
public static final int INCLUDE_PREFIXESFlag indicating that two element or attribute nodes are considered equal only if their names use the same namespace prefix- See Also:
-
INCLUDE_COMMENTS
public static final int INCLUDE_COMMENTSFlag indicating that comment children are taken into account when comparing element or document nodes- See Also:
-
INCLUDE_PROCESSING_INSTRUCTIONS
public static final int INCLUDE_PROCESSING_INSTRUCTIONSFlag indicating that processing instruction nodes are taken into account when comparing element or document nodes- See Also:
-
EXCLUDE_WHITESPACE_TEXT_NODES
public static final int EXCLUDE_WHITESPACE_TEXT_NODESFlag indicating that whitespace text nodes are ignored when comparing element nodes- See Also:
-
COMPARE_STRING_VALUES
public static final int COMPARE_STRING_VALUESFlag indicating that elements and attributes should always be compared according to their string value, not their typed value- See Also:
-
COMPARE_ANNOTATIONS
public static final int COMPARE_ANNOTATIONSFlag indicating that elements and attributes must have the same type annotation to be considered deep-equal- See Also:
-
WARNING_IF_FALSE
public static final int WARNING_IF_FALSEFlag indicating that a warning message explaining the reason why the sequences were deemed non-equal should be sent to the ErrorListener- See Also:
-
JOIN_ADJACENT_TEXT_NODES
public static final int JOIN_ADJACENT_TEXT_NODESFlag indicating that adjacent text nodes in the top-level sequence are to be merged- See Also:
-
-
Constructor Details
-
DeepEqual
public DeepEqual()
-
-
Method Details
-
preEvaluate
preEvaluate: if all arguments are known statically, evaluate early- Overrides:
preEvaluate
in classFunctionCall
- Throws:
XPathException
-
evaluateItem
Evaluate the expression- Specified by:
evaluateItem
in interfaceExpression
- Overrides:
evaluateItem
in classComputedExpression
- Parameters:
context
- The context in which the expression is to be evaluated- Returns:
- the node or atomic value that results from evaluating the expression; or null to indicate that the result is an empty sequence
- Throws:
XPathException
- if any dynamic error occurs evaluating the expression
-
deepEquals
public static boolean deepEquals(SequenceIterator op1, SequenceIterator op2, GenericAtomicComparer collator, Configuration config, int flags) Determine when two sequences are deep-equal- Parameters:
op1
- the first sequenceop2
- the second sequencecollator
- the collator to be usedconfig
- the configuration (gives access to the NamePool)flags
- bit-significant integer giving comparison options. Always zero for standard F+O deep-equals comparison.- Returns:
- true if the sequences are deep-equal
-