Class 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.
  • Constructor Details

    • XSLUsePackage

      public XSLUsePackage()
  • Method Details

    • 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:
      getUsedPackage in class StyleElement
      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 XPathException
      Description copied from class: StyleElement
      Set 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:
      prepareAttributes in class StyleElement
      Throws:
      XPathException - if a static error is detected
    • isDeclaration

      public boolean isDeclaration()
      Description copied from class: StyleElement
      Ask 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:
      isDeclaration in class StyleElement
      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: StyleElement
      Check 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:
      validate in class StyleElement
      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 XPathException
      Description copied from class: StyleElement
      Hook to allow additional validation of a parent element immediately after its children have been validated.
      Overrides:
      postValidate in class StyleElement
      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 package
      topLevel - 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.