Class NamespaceUriFunction

  • All Implemented Interfaces:
    Function

    public class NamespaceUriFunction
    extends java.lang.Object
    implements Function

    4.1 string namespace-uri(node-set?)

    The namespace-uri function returns the namespace URI of the expanded-name of the node in the argument node-set that is first in document order. If the argument node-set is empty, the first node has no expanded-name, or the namespace URI of the expanded-name is null, an empty string is returned. If the argument is omitted, it defaults to a node-set with the context node as its only member.

    NOTE: The string returned by the namespace-uri function will be empty except for element nodes and attribute nodes.
    See Also:
    Section 4.1 of the XPath Specification
    • Constructor Summary

      Constructors 
      Constructor Description
      NamespaceUriFunction()
      Create a new NamespaceUriFunction object.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object call​(Context context, java.util.List args)
      Returns the namespace URI of the specified node or the namespace URI of the context node if no arguments are provided.
      static java.lang.String evaluate​(java.util.List list, Navigator nav)
      Returns the namespace URI of list.get(0)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NamespaceUriFunction

        public NamespaceUriFunction()
        Create a new NamespaceUriFunction object.
    • Method Detail

      • call

        public java.lang.Object call​(Context context,
                                     java.util.List args)
                              throws FunctionCallException
        Returns the namespace URI of the specified node or the namespace URI of the context node if no arguments are provided.
        Specified by:
        call in interface Function
        Parameters:
        context - the context at the point in the expression where the function is called
        args - a List containing zero or one items
        Returns:
        a String containing the namespace URI
        Throws:
        FunctionCallException - if args has more than one item
      • evaluate

        public static java.lang.String evaluate​(java.util.List list,
                                                Navigator nav)
                                         throws FunctionCallException
        Returns the namespace URI of list.get(0)
        Parameters:
        list - a list of nodes
        nav - the Navigator used to retrieve the namespace
        Returns:
        the namespace URI of list.get(0)
        Throws:
        FunctionCallException - if list.get(0) is not a node