## net.sf.saxon.om
Interface NamespaceDeclarations

All Known Implementing Classes:
  NamespaceDeclarationsImpl, NamespaceResolverAsDeclarations

public interface NamespaceDeclarations

This interface represents a collection of namespace declarations or undeclarations, typically those appearing together in an element start tag. The order of declarations has no significance, and there will be no duplicates (that is, each declaration has a different prefix).

Method Summary
`int` `getLength()` Get the number of declarations (and undeclarations) in this list.
`int` `getNamespaceCode(int index)` Get the n'th declaration in the list in the form of a namespace code.
`java.lang.String` `getPrefix(int index)` Get the prefix of the n'th declaration (or undeclaration) in the list, counting from zero.
`java.lang.String` `getURI(int index)` Get the namespace URI of the n'th declaration (or undeclaration) in the list, counting from zero.

Method Detail

### getLength

    public int getLength()

  Get the number of declarations (and undeclarations) in this list.

### getPrefix

    public java.lang.String getPrefix(int index)

  Get the prefix of the n'th declaration (or undeclaration) in the list, counting from zero.

  Parameters:
    `index` - the index identifying which declaration is required.
  Returns:
    the namespace prefix. For a declaration or undeclaration of the default namespace, this is the zero-length string.
  Throws:
    `java.lang.IndexOutOfBoundsException` - if the index is out of range.

### getURI

    public java.lang.String getURI(int index)

  Get the namespace URI of the n'th declaration (or undeclaration) in the list, counting from zero.

  Parameters:
    `index` - the index identifying which declaration is required.
  Returns:
    the namespace URI. For a namespace undeclaration, this is the zero-length string.
  Throws:
    `java.lang.IndexOutOfBoundsException` - if the index is out of range.

### getNamespaceCode

    public int getNamespaceCode(int index)

  Get the n'th declaration in the list in the form of a namespace code. Namespace codes can be translated into a prefix and URI by means of methods in the NamePool

  Parameters:
    `index` - the index identifying which declaration is required.
  Returns:
    the namespace code. This is an integer whose upper half indicates the prefix (0 represents the default namespace), and whose lower half indicates the URI (0 represents an undeclaration).
  Throws:
    `java.lang.IndexOutOfBoundsException` - if the index is out of range.
  See Also:
    `NamePool.getPrefixFromNamespaceCode(int)`, `NamePool.getURIFromNamespaceCode(int)`