Package net.sf.saxon.style
Class XSLUsePackage
- java.lang.Object
-
- net.sf.saxon.tree.linked.NodeImpl
-
- net.sf.saxon.tree.linked.ParentNodeImpl
-
- net.sf.saxon.tree.linked.ElementImpl
-
- net.sf.saxon.style.StyleElement
-
- net.sf.saxon.style.XSLUsePackage
-
- All Implemented Interfaces:
Iterable<NodeInfo>,Source,SourceLocator,Location,GroundedValue<NodeInfo>,Item<NodeInfo>,MutableNodeInfo,NamespaceResolver,NodeInfo,Sequence<NodeInfo>,SteppingNode<NodeImpl>,SiblingCountingNode,Locator
public class XSLUsePackage extends StyleElement
Handler for xsl:use-package elements in stylesheet.
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.style.StyleElement
ACTION_COMPILE, ACTION_FIXUP, ACTION_OPTIMIZE, ACTION_PROCESS_ATTRIBUTES, ACTION_TYPECHECK, ACTION_VALIDATE, actionsCompleted, defaultCollationName, defaultMode, defaultXPathNamespace, expandText, extensionNamespaces, IGNORED_INSTRUCTION, REPORT_ALWAYS, REPORT_DYNAMICALLY_UNLESS_FALLBACK_AVAILABLE, REPORT_IF_INSTANTIATED, REPORT_STATICALLY_UNLESS_FALLBACK_AVAILABLE, REPORT_UNLESS_FORWARDS_COMPATIBLE, reportingCircumstances, staticContext, validationError, version, YES_NO
-
Fields inherited from class net.sf.saxon.tree.linked.NodeImpl
NODE_LETTER
-
Fields inherited from interface net.sf.saxon.om.NodeInfo
IS_DTD_TYPE, IS_NILLED
-
-
Constructor Summary
Constructors Constructor Description XSLUsePackage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfindUsedPackage(CompilerInfo info)Bind to the package to which this xsl:use-package element refers.voidgatherNamedOverrides(PrincipalStylesheetModule module, List<ComponentDeclaration> topLevel, Set<SymbolicName> overrides)Process all the xsl:override declarations in the xsl:use-package, adding the overriding named components to the list of top-level declarationsvoidgatherRuleOverrides(PrincipalStylesheetModule module, Set<SymbolicName> overrides)Process all the xsl:override declarations in the xsl:use-package, adding the overriding template rules to the list of top-level declarationsList<XSLAccept>getAcceptors()Get the child xsl:accept elementsSet<SymbolicName>getExplicitAcceptedComponentNames()Set<SymbolicName>getNamedOverrides()PackageVersionRangesgetPackageVersionRanges()Get the ranges of package versions this use-package directive will accept.StylesheetPackagegetUsedPackage()Get the package to which this xsl:use-package element refers.booleanisDeclaration()Ask whether this node is a declaration, that is, a permitted child of xsl:stylesheet (including xsl:include and xsl:import).voidpostValidate()Hook to allow additional validation of a parent element immediately after its children have been validated.protected voidprepareAttributes()Set the attribute list for the element.voidvalidate(ComponentDeclaration decl)Check that the stylesheet element is valid.-
Methods inherited from class net.sf.saxon.style.StyleElement
allocateLocalSlots, allocateLocation, bindLocalVariable, bindVariable, changesRetainedStaticContext, checkAttributeValue, checkEmpty, checkSortComesFirst, checkTopLevel, checkUnknownAttribute, compile, compileContentValueTemplate, compileDeclaration, compileError, compileError, compileError, compileError, compileError, compileErrorInAttribute, compileSequenceConstructor, compileSequenceConstructor, compileWarning, compileWarning, definesExcludedNamespace, definesExtensionElement, fallbackProcessing, findAncestorElement, findCollation, fixupReferences, forwardsCompatibleModeIsEnabled, generateId, getAttributeValue, getBaseURI, getBindingInformation, getCompilation, getConfiguration, getConstructType, getContainingPackage, getContainingSlotManager, getContainingStylesheet, getDeclaredVisibility, getDefaultCollationName, getDefaultMode, getDefaultValidation, getDefaultXPathNamespace, getEffectiveVersion, getEffectiveVersionAsString, getLastChildInstruction, getNamespaceResolver, getObjectName, getOverriddenComponent, getPackageData, getPrincipalStylesheetModule, getProperties, getProperty, getSchemaType, getStaticContext, getStaticContext, getTypeAnnotation, getUsedAttributeSets, getVisibility, getWithParamInstructions, getXslOriginal, hasImplicitBinding, index, interpretVisibilityValue, invalidAttribute, isActionCompleted, isConstructingComplexContent, isExcludedNamespace, isExpandingText, isExtensionNamespace, isInstruction, isNo, isPermittedChild, isSchemaAware, issueWarning, issueWarning, isTopLevel, isWithinDeclaredStreamableConstruct, isYes, makeAttributeValueTemplate, makeExpression, makeExpressionVisitor, makeExtendedSequenceType, makeNamespaceContext, makePattern, makeQName, makeRetainedStaticContext, makeSequenceType, makeSortKeys, makeTraceInstruction, markTailCalls, mayContainFallback, mayContainParam, mayContainSequenceConstructor, processAllAttributes, processAttributes, processBooleanAttribute, processDefaultCollationAttribute, processDefaultMode, processDefaultValidationAttribute, processDefaultXPathNamespaceAttribute, processExcludedNamespaces, processExpandTextAttribute, processExtensionElementAttribute, processStandardAttributes, processStreamableAtt, processVersionAttribute, reportAbsence, seesAvuncularVariables, setActionCompleted, setCompilation, setIgnoreInstruction, setObjectName, setValidationError, substituteFor, typeCheck, typeCheck, undeclaredNamespaceError, validateChildren, validateSubtree, validateValidationAttribute, xPath10ModeIsEnabled
-
Methods inherited from class net.sf.saxon.tree.linked.ElementImpl
addAttribute, addNamespace, copy, delete, fixupInsertedNamespaces, generateId, getAttributeList, getAttributeValue, getColumnNumber, getDeclaredNamespaces, getLineNumber, getNamespaceList, getNodeKind, getNodeName, getRoot, getSchemaType, getSystemId, getURIForPrefix, gsetAttributeCollection, initialise, isId, isIdref, isInScopeNamespace, isNilled, iteratePrefixes, removeAttribute, removeTypeAnnotation, rename, replaceStringValue, setAttributeList, setLocation, setNamespaceDeclarations, setNamespaceList, setNilled, setNodeName, setSystemId, setTypeAnnotation
-
Methods inherited from class net.sf.saxon.tree.linked.ParentNodeImpl
addChild, compact, getFirstChild, getLastChild, getNthChild, getNumberOfChildren, getRawSequenceNumber, getSequenceNumber, getStringValue, getStringValueCS, hasChildNodes, insertChildren, insertChildrenAt, iterateChildren, removeChild, replaceChildrenAt, setChildren, setRawSequenceNumber
-
Methods inherited from class net.sf.saxon.tree.linked.NodeImpl
atomize, compareOrder, effectiveBooleanValue, equals, getDisplayName, getFingerprint, getLocalPart, getNamePool, getNextInDocument, getNextSibling, getParent, getPhysicalRoot, getPrefix, getPreviousInDocument, getPreviousSibling, getRawParent, getSiblingPosition, getSuccessorElement, getTreeInfo, getURI, hasFingerprint, head, insertSiblings, isDeleted, iterate, iterateAxis, iterateAxis, newBuilder, replace, saveLocation, setRawParent, setSiblingPosition
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, materialize
-
Methods inherited from interface net.sf.saxon.om.Item
getLength, itemAt, iterator, reduce, subsequence
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface net.sf.saxon.om.NodeInfo
equals, getGenre, getPublicId, hashCode, isSameNodeInfo, isStreamed, toShortString
-
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
-
-
-
Method Detail
-
findUsedPackage
public void findUsedPackage(CompilerInfo info) throws XPathException
Bind to the package to which this xsl:use-package element refers.- Throws:
XPathException
-
getUsedPackage
public StylesheetPackage getUsedPackage()
Get the package to which this xsl:use-package element refers. Assumes that findPackage() has already been called.- Overrides:
getUsedPackagein classStyleElement- Returns:
- the package that is referenced.
-
getPackageVersionRanges
public PackageVersionRanges getPackageVersionRanges() throws XPathException
Get the ranges of package versions this use-package directive will accept.This will involve processing the attributes once to derive any ranges declared (and the name of the required package). If no range is defined, the catchall '*' is assumed.
- Returns:
- the ranges of versions of the named package that this declaration will accept
- Throws:
XPathException
-
prepareAttributes
protected void prepareAttributes() throws XPathExceptionDescription 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
-
isDeclaration
public boolean isDeclaration()
Description copied from class:StyleElementAsk whether this node is a declaration, that is, a permitted child of xsl:stylesheet (including xsl:include and xsl:import). The default implementation returns false- Overrides:
isDeclarationin classStyleElement- Returns:
- true if the element is a permitted child of xsl:stylesheet or xsl:transform
-
validate
public void validate(ComponentDeclaration decl) throws XPathException
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
-
getExplicitAcceptedComponentNames
public Set<SymbolicName> getExplicitAcceptedComponentNames() throws XPathException
- Throws:
XPathException
-
postValidate
public void postValidate() throws XPathExceptionDescription copied from class:StyleElementHook to allow additional validation of a parent element immediately after its children have been validated.- Overrides:
postValidatein classStyleElement- Throws:
XPathException- if any error is found during post-traversal validation
-
getAcceptors
public List<XSLAccept> getAcceptors()
Get the child xsl:accept elements- Returns:
- the list of child xsl:accept elements
-
gatherNamedOverrides
public void gatherNamedOverrides(PrincipalStylesheetModule module, List<ComponentDeclaration> topLevel, Set<SymbolicName> overrides) throws XPathException
Process all the xsl:override declarations in the xsl:use-package, adding the overriding named components to the list of top-level declarations- Parameters:
module- the top-level stylesheet module of this packagetopLevel- the list of declarations in this package (to which this method appends)overrides- set of named components for which this xsl:use-package provides an override (which this method populates).- Throws:
XPathException- in the event of an error.
-
getNamedOverrides
public Set<SymbolicName> getNamedOverrides() throws XPathException
- Throws:
XPathException
-
gatherRuleOverrides
public void gatherRuleOverrides(PrincipalStylesheetModule module, Set<SymbolicName> overrides) throws XPathException
Process all the xsl:override declarations in the xsl:use-package, adding the overriding template rules to the list of top-level declarations- Parameters:
module- the top-level stylesheet module of this package (the using package)overrides- set of named components for which this xsl:use-package provides an override (which this method populates). If the xsl:override contains any template rules, then the named mode will be included in this list, but the individual template rules will not be added to the top-level list.- Throws:
XPathException- in the event of an error.
-
-