org.apache.xalan.extensions

## Class ExtensionNamespaceContext

- java.lang.Object
- - org.apache.xalan.extensions.ExtensionNamespaceContext

- All Implemented Interfaces:
    NamespaceContext

      public class ExtensionNamespaceContext
      extends java.lang.Object
      implements NamespaceContext

  A sample implementation of NamespaceContext, with support for EXSLT extension functions and Java extension functions.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `EXSLT_DATETIME_PREFIX`
    `static java.lang.String` | `EXSLT_DATETIME_URI`
    `static java.lang.String` | `EXSLT_DYNAMIC_PREFIX`
    `static java.lang.String` | `EXSLT_DYNAMIC_URI`
    `static java.lang.String` | `EXSLT_MATH_PREFIX`
    `static java.lang.String` | `EXSLT_MATH_URI`
    `static java.lang.String` | `EXSLT_PREFIX`
    `static java.lang.String` | `EXSLT_SET_PREFIX`
    `static java.lang.String` | `EXSLT_SET_URI`
    `static java.lang.String` | `EXSLT_STRING_PREFIX`
    `static java.lang.String` | `EXSLT_STRING_URI`
    `static java.lang.String` | `EXSLT_URI`
    `static java.lang.String` | `JAVA_EXT_PREFIX`
    `static java.lang.String` | `JAVA_EXT_URI`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExtensionNamespaceContext()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getNamespaceURI(java.lang.String prefix)` Return the namespace uri for a given prefix
    `java.lang.String` | `getPrefix(java.lang.String namespace)` Return the prefix for a given namespace uri.
    `java.util.Iterator` | `getPrefixes(java.lang.String namespace)` Get all prefixes bound to a Namespace URI in the current scope.

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

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

- - ### Field Detail

    - #### EXSLT_PREFIX

          public static final java.lang.String EXSLT_PREFIX

      See Also:
        Constant Field Values

    - #### EXSLT_URI

          public static final java.lang.String EXSLT_URI

      See Also:
        Constant Field Values

    - #### EXSLT_MATH_PREFIX

          public static final java.lang.String EXSLT_MATH_PREFIX

      See Also:
        Constant Field Values

    - #### EXSLT_MATH_URI

          public static final java.lang.String EXSLT_MATH_URI

      See Also:
        Constant Field Values

    - #### EXSLT_SET_PREFIX

          public static final java.lang.String EXSLT_SET_PREFIX

      See Also:
        Constant Field Values

    - #### EXSLT_SET_URI

          public static final java.lang.String EXSLT_SET_URI

      See Also:
        Constant Field Values

    - #### EXSLT_STRING_PREFIX

          public static final java.lang.String EXSLT_STRING_PREFIX

      See Also:
        Constant Field Values

    - #### EXSLT_STRING_URI

          public static final java.lang.String EXSLT_STRING_URI

      See Also:
        Constant Field Values

    - #### EXSLT_DATETIME_PREFIX

          public static final java.lang.String EXSLT_DATETIME_PREFIX

      See Also:
        Constant Field Values

    - #### EXSLT_DATETIME_URI

          public static final java.lang.String EXSLT_DATETIME_URI

      See Also:
        Constant Field Values

    - #### EXSLT_DYNAMIC_PREFIX

          public static final java.lang.String EXSLT_DYNAMIC_PREFIX

      See Also:
        Constant Field Values

    - #### EXSLT_DYNAMIC_URI

          public static final java.lang.String EXSLT_DYNAMIC_URI

      See Also:
        Constant Field Values

    - #### JAVA_EXT_PREFIX

          public static final java.lang.String JAVA_EXT_PREFIX

      See Also:
        Constant Field Values

    - #### JAVA_EXT_URI

          public static final java.lang.String JAVA_EXT_URI

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ExtensionNamespaceContext

          public ExtensionNamespaceContext()

  - ### Method Detail

    - #### getNamespaceURI

          public java.lang.String getNamespaceURI(java.lang.String prefix)

      Return the namespace uri for a given prefix
      Specified by:
        `getNamespaceURI` in interface `NamespaceContext`
      Parameters:
        `prefix` - prefix to look up
      Returns:
        Namespace URI bound to prefix in the current scope

    - #### getPrefix

          public java.lang.String getPrefix(java.lang.String namespace)

      Return the prefix for a given namespace uri.
      Specified by:
        `getPrefix` in interface `NamespaceContext`
      Parameters:
        `namespace` - URI of Namespace to lookup
      Returns:
        prefix bound to Namespace URI in current context

    - #### getPrefixes

          public java.util.Iterator getPrefixes(java.lang.String namespace)

      Description copied from interface: `NamespaceContext`

      Get all prefixes bound to a Namespace URI in the current scope.

      An Iterator over String elements is returned in an arbitrary, implementation dependent, order.

      The `Iterator` is not modifiable. e.g. the `remove()` method will throw `UnsupportedOperationException`.

      When requesting prefixes by Namespace URI, the following table describes the returned prefixes value for all Namespace URI values:

      `getPrefixes(namespaceURI)` return value for specified Namespace URIs
      Namespace URI parameter | prefixes value returned
      bound Namespace URI, including the <default Namespace URI> | `Iterator` over prefixes bound to Namespace URI in the current scope in an arbitrary, implementation dependent, order
      unbound Namespace URI | empty `Iterator`
      `XMLConstants.XML_NS_URI` ("http://www.w3.org/XML/1998/namespace") | `Iterator` with one element set to `XMLConstants.XML_NS_PREFIX` ("xml")
      `XMLConstants.XMLNS_ATTRIBUTE_NS_URI` ("http://www.w3.org/2000/xmlns/") | `Iterator` with one element set to `XMLConstants.XMLNS_ATTRIBUTE` ("xmlns")
      `null` | `IllegalArgumentException` is thrown

      Specified by:
        `getPrefixes` in interface `NamespaceContext`
      Parameters:
        `namespace` - URI of Namespace to lookup
      Returns:
        `Iterator` for all prefixes bound to the Namespace URI in the current scope

Copyright © 2014 Apache XML Project. All Rights Reserved.