net.sf.saxon.functions

Class NamePart

Implemented Interfaces:
EvaluableItem, InstructionInfoProvider, SequenceIterable, Serializable, SourceLocator

public class NamePart
extends SystemFunction

This class supports the name(), local-name(), and namespace-uri() functions from XPath 1.0, and also the XSLT generate-id() function

Field Summary

static int
DOCUMENT_URI
static int
GENERATE_ID
static int
LOCAL_NAME
static int
NAME
static int
NAMESPACE_URI
static int
NODE_NAME

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.Expression

EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD, locationId, staticProperties

Method Summary

int
computeSpecialProperties()
Determine the special properties of this expression.
Item
evaluateItem(XPathContext c)
Evaluate the function in a string context
static boolean
isGenerateIdFunction(Expression exp)
Test whether an expression is a call on the generate-id() function
Expression
simplify(ExpressionVisitor visitor)
Simplify and validate.

Methods inherited from class net.sf.saxon.functions.SystemFunction

addContextDocumentArgument, addDocToPathMap, checkArguments, computeCardinality, computeSpecialProperties, copy, getDetails, getErrorCodeForTypeErrors, getItemType, getRequiredType, makeSystemFunction, optimize, setDetails, useContextItemAsDefault

Methods inherited from class net.sf.saxon.expr.FunctionCall

addExternalFunctionCallToPathMap, checkArgumentCount, checkArguments, equals, explain, getArguments, getDisplayName, getFunctionName, getNumberOfArguments, hashCode, iterateSubExpressions, optimize, preEvaluate, promote, replaceSubExpression, setArguments, setFunctionName, simplify, simplifyArguments, toString, typeCheck

Methods inherited from class net.sf.saxon.expr.Expression

addToPathMap, adoptChildExpression, checkPermittedContents, computeCardinality, computeDependencies, computeSpecialProperties, computeStaticProperties, copy, display, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, explain, explain, findParentOf, getCardinality, getColumnNumber, getConstructType, getContainer, getDependencies, getExecutable, getHostLanguage, getImplementationMethod, getInstructionInfo, getIntrinsicDependencies, getItemType, getLineNumber, getLocationId, getLocationProvider, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasLoopingSubexpression, implementsStaticTypeCheck, iterate, iterateEvents, iterateSubExpressions, markTailFunctionCalls, optimize, process, promote, replaceSubExpression, resetLocalStaticProperties, setContainer, setFiltered, setFlattened, setLocationId, simplify, staticTypeCheck, suppressValidation, toString, typeCheck, typeError

Field Details

DOCUMENT_URI

public static final int DOCUMENT_URI
Field Value:
4

GENERATE_ID

public static final int GENERATE_ID
Field Value:
3

LOCAL_NAME

public static final int LOCAL_NAME
Field Value:
1

NAME

public static final int NAME
Field Value:
0

NAMESPACE_URI

public static final int NAMESPACE_URI
Field Value:
2

NODE_NAME

public static final int NODE_NAME
Field Value:
6

Method Details

computeSpecialProperties

public int computeSpecialProperties()
Determine the special properties of this expression. The generate-id() function is a special case: it is considered creative if its operand is creative, so that generate-id(f()) is not taken out of a loop
Overrides:
computeSpecialProperties in interface SystemFunction

evaluateItem

public Item evaluateItem(XPathContext c)
            throws XPathException
Evaluate the function in a string context
Specified by:
evaluateItem in interface EvaluableItem
Overrides:
evaluateItem in interface Expression

isGenerateIdFunction

public static boolean isGenerateIdFunction(Expression exp)
Test whether an expression is a call on the generate-id() function
Parameters:
exp - the expression to be tested
Returns:
true if exp is a call on generate-id(), else false

simplify

public Expression simplify(ExpressionVisitor visitor)
            throws XPathException
Simplify and validate.
Overrides:
simplify in interface FunctionCall
Parameters:
visitor - an expression visitor