Class NS

java.lang.Object
org.libxmq.NS

public final class NS extends Object
The namespace of an element added with XMQ.addElement etc, like XMQNS in xmq.h. The uri can be prefixed with {prefix}, eg NS.here("{drv}urn:myapp:driver").
NS.NONE                   No namespace.
NS.PARENT                 The same namespace as the parent.
NS.here(uri)              Declare the namespace on the element.
NS.ancestor(uri)          Use the namespace declared on an ancestor. If no ancestor
                          declares it, it is declared on the root element, with a
                          generated prefix ns1, ns2... if no prefix is given.
  • Field Details

    • NONE

      public static final NS NONE
      No namespace, like NS_NONE.
    • PARENT

      public static final NS PARENT
      The same namespace as the parent, like NS_PARENT.
  • Method Details

    • here

      public static NS here(String uri)
      Declare the namespace on the element, like NS_HERE.
      Parameters:
      uri - The namespace uri, eg urn:cargo or {c}urn:cargo for the prefix c.
      Returns:
      The namespace.
    • ancestor

      public static NS ancestor(String uri)
      Use the namespace declared on an ancestor, like NS_ANCESTOR.
      Parameters:
      uri - The namespace uri, eg urn:cargo or {c}urn:cargo for the prefix c.
      Returns:
      The namespace.