Overview | Package | Class | Deprecated | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sf.saxon.om
Interface NamespaceDeclarations

All Known Implementing Classes:
  EmptyNamespaceDeclarationList, NamespaceDeclarationsImpl, NamespaceResolverAsDeclarations, StaxBridge.StaxNamespaces, VirtualTreeWalker

    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` | `getNamespaceCode(int index)` Get the n'th declaration in the list in the form of a namespace code.
`int[]` | `getNamespaceCodes(int[] buffer)` Get all the namespace codes, as an array.
`int` | `getNumberOfNamespaces()` Get the number of declarations (and undeclarations) in this list.
`String` | `getPrefix(int index)` Get the prefix of the n'th declaration (or undeclaration) in the list, counting from zero.
`String` | `getURI(int index)` Get the namespace URI of the n'th declaration (or undeclaration) in the list, counting from zero.

Method Detail

### getNumberOfNamespaces

    int getNumberOfNamespaces()

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

### getPrefix

    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:
    `IndexOutOfBoundsException` - if the index is out of range.

### getURI

    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:
    `IndexOutOfBoundsException` - if the index is out of range.

### getNamespaceCode

    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:
    `IndexOutOfBoundsException` - if the index is out of range.
  See Also:
    `NamePool.getPrefixFromNamespaceCode(int)`, `NamePool.getURIFromNamespaceCode(int)`

### getNamespaceCodes

    int[] getNamespaceCodes(int[] buffer)

  Get all the namespace codes, as an array.

  Parameters:
    `buffer` - a sacrificial array that the method is free to use to contain the result. May be null.
  Returns:
    an integer array containing namespace codes. The array may be filled completely with namespace codes, or it may be incompletely filled, in which case a -1 integer acts as a terminator.

Overview | Package | Class | Deprecated | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (C) Michael H. Kay. All rights reserved.