org.apache.xalan.transformer

## Class KeyTable

- java.lang.Object
- - org.apache.xalan.transformer.KeyTable

-     public class KeyTable
      extends java.lang.Object

  Table of element keys, keyed by document node. An instance of this class is keyed by a Document node that should be matched with the root of the current context.
  Usage:
    **For advanced use only**

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `KeyTable(int doc, PrefixResolver nscontext, QName name, java.util.Vector keyDeclarations, XPathContext xctxt)` Build a keys table.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getDocKey()` Get the document root matching this key.
    `QName` | `getKeyTableName()` Get Key Name for this KeyTable
    `XNodeSet` | `getNodeSetDTMByKey(QName name, XMLString ref)` Given a valid element key, return the corresponding node list.

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

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

- - ### Constructor Detail

    - #### KeyTable

          public KeyTable(int doc,
                          PrefixResolver nscontext,
                          QName name,
                          java.util.Vector keyDeclarations,
                          XPathContext xctxt)
                   throws javax.xml.transform.TransformerException

      Build a keys table.
      Parameters:
        `doc` - The owner document key.
        `nscontext` - The stylesheet's namespace context.
        `name` - The key name
        `keyDeclarations` - The stylesheet's xsl:key declarations.
      Throws:
        `javax.xml.transform.TransformerException`

  - ### Method Detail

    - #### getDocKey

          public int getDocKey()

      Get the document root matching this key.
      Returns:
        the document root matching this key

    - #### getNodeSetDTMByKey

          public XNodeSet getNodeSetDTMByKey(QName name,
                                             XMLString ref)

      Given a valid element key, return the corresponding node list.
      Parameters:
        `name` - The name of the key, which must match the 'name' attribute on xsl:key.
        `ref` - The value that must match the value found by the 'match' attribute on xsl:key.
      Returns:
        a set of nodes referenced by the key named `name` and the reference `ref`. If no node is referenced by this key, an empty node set is returned.

    - #### getKeyTableName

          public QName getKeyTableName()

      Get Key Name for this KeyTable
      Returns:
        Key name

Copyright © 2023 Apache XML Project. All Rights Reserved.