Interface NamespaceContext


  • @API(type=NOT_EXTENDABLE,
         src=PUBLIC)
    public interface NamespaceContext
    Useful interface which can be used to obtain mappings from prefix to namespace and from namespace to prefix in the context of the current element.
    Since:
    13
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getNamespaceForPrefix​(java.lang.String prefix)
      Get the namespace corresponding to a prefix in the current element context.
      java.lang.String[] getNamespaces()
      Returns all the namespaces active in the current context.
      java.lang.String getPrefixForNamespace​(java.lang.String namespace)
      Get the prefix which is bound to a specified namespace in the current element context.
    • Method Detail

      • getNamespaceForPrefix

        java.lang.String getNamespaceForPrefix​(java.lang.String prefix)
        Get the namespace corresponding to a prefix in the current element context.
        Parameters:
        prefix - The prefix.
        Returns:
        The namespace corresponding to the prefix or null if no mapping was found.
      • getPrefixForNamespace

        java.lang.String getPrefixForNamespace​(java.lang.String namespace)
        Get the prefix which is bound to a specified namespace in the current element context.
        Parameters:
        namespace - The namespace.
        Returns:
        the prefix which is bound to a specified namespace in the current element context or null if no mapping was found.
      • getNamespaces

        java.lang.String[] getNamespaces()
        Returns all the namespaces active in the current context.
        Returns:
        All the namespaces active in the current context.
        Since:
        18