Class XSLIf
- All Implemented Interfaces:
Serializable, Source, SourceLocator, LocationProvider, SaxonLocator, PullEvent, Container, FingerprintedNode, Item<NodeInfo>, MutableNodeInfo, NamespaceResolver, NodeInfo, ValueRepresentation<NodeInfo>, InstructionInfo, SiblingCountingNode, Locator
Handler for xsl:if elements in stylesheet.
The xsl:if element has a mandatory attribute test, a boolean expression. The content is output if the test condition is true.
The xsl:if element has a mandatory attribute test, a boolean expression. The content is output if the test condition is true.
- See Also:
-
Field Summary
Fields inherited from class StyleElement
ACTION_COMPILE, ACTION_FIXUP, ACTION_OPTIMIZE, ACTION_PROCESS_ATTRIBUTES, ACTION_TYPECHECK, ACTION_VALIDATE, actionsCompleted, defaultCollationName, defaultXPathNamespace, extensionNamespaces, REPORT_ALWAYS, REPORT_IF_INSTANTIATED, REPORT_UNLESS_FALLBACK_AVAILABLE, REPORT_UNLESS_FORWARDS_COMPATIBLE, reportingCircumstances, staticContext, validationError, version, YES_NOFields inherited from class NodeImpl
NODE_LETTERFields inherited from interface NodeInfo
ALL_NAMESPACES, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACESFields inherited from interface ValueRepresentation
EMPTY_VALUE_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncompile(Executable exec, Declaration decl) Compile the instruction on the stylesheet tree into an executable instruction for use at run-time.protected ItemTypeDetermine the type of item returned by this instruction (only relevant if it is an instruction).booleanDetermine whether this node is an instruction.booleanMark tail-recursive calls on stylesheet functions.booleanDetermine whether this type of element is allowed to contain a template-bodyvoidSet the attribute list for the element.static ExpressionProcess all the attributes, for an element where the only permitted attribute is "test"voidvalidate(Declaration decl) Check that the stylesheet element is valid.Methods inherited from class StyleElement
allocateLocationId, allocatePatternSlots, allocateSlots, bindLocalVariable, bindVariable, checkAttributeValue, checkEmpty, checkSortComesFirst, checkTopLevel, checkUnknownAttribute, compileDeclaration, compileError, compileError, compileError, compileError, compileSequenceConstructor, compileWarning, compileWarning, definesExcludedNamespace, definesExtensionElement, fallbackProcessing, fixupReferences, forwardsCompatibleModeIsEnabled, getAttributeSets, getAttributeValue, getColumnNumber, getCommonChildItemType, getConstructType, getContainerGranularity, getContainingSlotManager, getContainingStylesheet, getDefaultCollationName, getDefaultXPathNamespace, getEffectiveVersion, getExecutable, getHostLanguage, getLastChildInstruction, getLineNumber, getLocationProvider, getNamespaceResolver, getObjectName, getPreparedStylesheet, getPrincipalStylesheetModule, getProcessorVersion, getProperties, getProperty, getSchemaType, getStaticContext, getSystemId, getTypeAnnotation, getWithParamInstructions, index, isActionCompleted, isDeclaration, isExcludedNamespace, isExplaining, isExtensionNamespace, isPermittedChild, issueWarning, issueWarning, isTopLevel, isXslt30Processor, makeAttributeValueTemplate, makeExpression, makeExpressionVisitor, makeNamespaceContext, makePattern, makeQName, makeSequenceType, makeSortKeys, makeTraceInstruction, mayContainFallback, mayContainParam, postValidate, processAllAttributes, processAttributes, processDefaultCollationAttribute, processDefaultXPathNamespaceAttribute, processExcludedNamespaces, processExtensionElementAttribute, processStandardAttributes, processVersionAttribute, reportAbsence, seesAvuncularVariables, setActionCompleted, setObjectName, setValidationError, substituteFor, typeCheck, typeCheck, undeclaredNamespaceError, validateChildren, validateSubtree, xPath10ModeIsEnabledMethods inherited from class ElementImpl
addAttribute, addNamespace, copy, delete, fixupInsertedNamespaces, generateId, getAttributeList, getAttributeValue, getAttributeValue, getBaseURI, getColumnNumber, getDeclaredNamespaces, getDocumentRoot, getLineNumber, getNameCode, getNamespaceList, getNodeKind, getPrefixForURI, getRoot, getSchemaType, getSystemId, getTypeAnnotation, getURIForPrefix, gsetAttributeCollection, initialise, isId, isNilled, iteratePrefixes, removeAttribute, removeTypeAnnotation, rename, replaceStringValue, setAttributeList, setLocation, setNameCode, setNamespaceDeclarations, setNamespaceList, setSystemId, setTypeAnnotationMethods inherited from class ParentNodeImpl
addChild, compact, enumerateChildren, getFirstChild, getLastChild, getNthChild, getNumberOfChildren, getRawSequenceNumber, getSequenceNumber, getStringValue, getStringValueCS, hasChildNodes, insertChildren, insertChildrenAt, removeChild, replaceChildrenAt, setChildren, setRawSequenceNumberMethods inherited from class NodeImpl
atomize, compareOrder, equals, getConfiguration, getDisplayName, getDocumentNumber, getFingerprint, getLocalPart, getNamePool, getNextInDocument, getNextSibling, getParent, getPhysicalRoot, getPrefix, getPreviousInDocument, getPreviousSibling, getPublicId, getRawParent, getSiblingPosition, getTypedValue, getURI, insertSiblings, isDeleted, isIdref, isSameNodeInfo, iterateAxis, iterateAxis, newBuilder, replace, setRawParent, setSiblingPositionMethods inherited from class Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface InstructionInfo
getLineNumber, getSystemIdMethods inherited from interface Locator
getColumnNumber, getPublicIdMethods inherited from interface SourceLocator
getColumnNumber, getLineNumber, getPublicId, getSystemId
-
Constructor Details
-
XSLIf
public XSLIf()
-
-
Method Details
-
isInstruction
public boolean isInstruction()Determine whether this node is an instruction.- Overrides:
isInstructionin classStyleElement- Returns:
- true - it is an instruction
-
getReturnedItemType
Determine the type of item returned by this instruction (only relevant if it is an instruction).- Overrides:
getReturnedItemTypein classStyleElement- Returns:
- the item type returned
-
mayContainSequenceConstructor
public boolean mayContainSequenceConstructor()Determine whether this type of element is allowed to contain a template-body- Overrides:
mayContainSequenceConstructorin classStyleElement- Returns:
- true: yes, it may contain a template-body
-
prepareAttributes
Description copied from class:StyleElementSet the attribute list for the element. This is called to process the attributes (note the distinction from processAttributes in the superclass). Must be supplied in a subclass- Specified by:
prepareAttributesin classStyleElement- Throws:
XPathException- if a static error is detected
-
prepareTestAttribute
Process all the attributes, for an element where the only permitted attribute is "test"- Parameters:
se- the containing element- Returns:
- the expression represented by the test attribute, or null if the attribute is absent
- Throws:
XPathException- if an error is encountered
-
validate
Description copied from class:StyleElementCheck that the stylesheet element is valid. This is called once for each element, after the entire tree has been built. As well as validation, it can perform first-time initialisation. The default implementation does nothing; it is normally overriden in subclasses.- Overrides:
validatein classStyleElement- Parameters:
decl- the declaration to be validated- Throws:
XPathException- if any error is found during validation
-
markTailCalls
public boolean markTailCalls()Mark tail-recursive calls on stylesheet functions. For most instructions, this does nothing.- Overrides:
markTailCallsin classStyleElement- Returns:
- true if one or more tail calls were identified
-
compile
Description copied from class:StyleElementCompile the instruction on the stylesheet tree into an executable instruction for use at run-time.- Overrides:
compilein classStyleElement- Parameters:
exec- the Executabledecl- the containing top-level declaration, for example xsl:function or xsl:template- Returns:
- either a ComputedExpression, or null. The value null is returned when compiling an instruction that returns a no-op, or when compiling a top-level object such as an xsl:template that compiles into something other than an instruction.
- Throws:
XPathException- if validation fails
-