Package net.sf.saxon.style

## Class StyleNodeFactory

- java.lang.Object
- - net.sf.saxon.style.StyleNodeFactory

- All Implemented Interfaces:
    `NodeFactory`
  Direct Known Subclasses:
    `StyleNodeFactoryPE`

      public class StyleNodeFactory
      extends java.lang.Object
      implements NodeFactory

  Class StyleNodeFactory.
  A Factory for nodes in the stylesheet tree.
  Currently only allows Element nodes to be user-constructed.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected Configuration` | `config` |
    `protected NamePool` | `namePool` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `StyleNodeFactory​(Configuration config, Compilation compilation)` | Create the node factory for representing an XSLT stylesheet as a tree structure

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Compilation` | `getCompilation()` |
    `Configuration` | `getConfiguration()` |
    `boolean` | `isElementAvailable​(java.lang.String uri, java.lang.String localName, boolean instructionsOnly)` | Method to support the element-available() function
    `boolean` | `isTopLevelModule()` | Ask whether this is the top-level module of a package
    `AccumulatorRegistry` | `makeAccumulatorManager()` |
    `ElementImpl` | `makeElementNode​(NodeInfo parent, NodeName elemName, SchemaType elemType, boolean isNilled, AttributeMap attlist, NamespaceMap namespaces, PipelineConfiguration pipe, Location location, int sequence)` | Create an Element node.
    `TextImpl` | `makeTextNode​(NodeInfo parent, java.lang.CharSequence content)` | Make a text node
    `protected StyleElement` | `makeXSLElement​(int f, NodeImpl parent)` | Make an XSL element node
    `PrincipalStylesheetModule` | `newPrincipalModule​(XSLPackage node)` | Create a stylesheet package
    `void` | `setTopLevelModule​(boolean topLevelModule)` | Say that this is the top-level module of a package

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### config

          protected Configuration config

    - #### namePool

          protected NamePool namePool

  - ### Constructor Detail

    - #### StyleNodeFactory

          public StyleNodeFactory​(Configuration config,
                                  Compilation compilation)

      Create the node factory for representing an XSLT stylesheet as a tree structure
      Parameters:
        `config` - the Saxon configuration
        `compilation` - the compilation episode (compiling one package)

  - ### Method Detail

    - #### setTopLevelModule

          public void setTopLevelModule​(boolean topLevelModule)

      Say that this is the top-level module of a package
      Parameters:
        `topLevelModule` - true if this stylesheet module is the top level of a package; false if it is included or imported

    - #### isTopLevelModule

          public boolean isTopLevelModule()

      Ask whether this is the top-level module of a package
      Returns:
        true if this stylesheet module is the top level of a package; false if it is included or imported

    - #### getCompilation

          public Compilation getCompilation()

    - #### getConfiguration

          public Configuration getConfiguration()

    - #### makeElementNode

          public ElementImpl makeElementNode​(NodeInfo parent,
                                             NodeName elemName,
                                             SchemaType elemType,
                                             boolean isNilled,
                                             AttributeMap attlist,
                                             NamespaceMap namespaces,
                                             PipelineConfiguration pipe,
                                             Location location,
                                             int sequence)

      Create an Element node. Note, if there is an error detected while constructing the Element, we add the element anyway, and return success, but flag the element with a validation error. This allows us to report more than one error from a single compilation.
      Specified by:
        `makeElementNode` in interface `NodeFactory`
      Parameters:
        `parent` - The parent element
        `elemName` - The element name
        `elemType` - The type annotation of the element
        `isNilled` - true if the element is to be marked as nilled
        `attlist` - The attribute collection, excluding any namespace attributes
        `namespaces` - in-scope namespace declarations for this element
        `pipe` - The pipeline configuration (provides access to the error listener and the location provider)
        `location` - Indicates the source document and line number containing the node
        `sequence` - Sequence number to be assigned to represent document order.
      Returns:
        the element node

    - #### makeXSLElement

          protected StyleElement makeXSLElement​(int f,
                                                NodeImpl parent)

      Make an XSL element node
      Parameters:
        `f` - the fingerprint of the node name
        `parent` - the parent node
      Returns:
        the constructed element node

    - #### makeTextNode

          public TextImpl makeTextNode​(NodeInfo parent,
                                       java.lang.CharSequence content)

      Make a text node
      Specified by:
        `makeTextNode` in interface `NodeFactory`
      Parameters:
        `parent` - the parent element
        `content` - the content of the text node
      Returns:
        the constructed text node

    - #### isElementAvailable

          public boolean isElementAvailable​(java.lang.String uri,
                                            java.lang.String localName,
                                            boolean instructionsOnly)

      Method to support the element-available() function
      Parameters:
        `uri` - the namespace URI
        `localName` - the local Name
        `instructionsOnly` - true if only instruction elements qualify
      Returns:
        true if an extension element of this name is recognized

    - #### makeAccumulatorManager

          public AccumulatorRegistry makeAccumulatorManager()

    - #### newPrincipalModule

          public PrincipalStylesheetModule newPrincipalModule​(XSLPackage node)
                                                       throws XPathException

      Create a stylesheet package
      Parameters:
        `node` - the XSLPackage element
      Returns:
        a new stylesheet package
      Throws:
        `XPathException`