com.marklogic.xcc.types

## Class XName

- java.lang.Object
- - com.marklogic.xcc.types.XName

-     public class XName
      extends java.lang.Object

  An Expanded Name, consisting of a (optional) namespace name and a local name. XName instances are immutable and may be shared.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XName(java.lang.String localname)` Construct an XName with the given local name in the default namespace.
    `XName(java.lang.String namespace, java.lang.String localname)` Construct an XName with the given namespace name and local name.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)`
    `java.lang.String` | `getLocalname()` This XName's local name.
    `java.lang.String` | `getNamespace()` This XName's namespace name, if defined.
    `int` | `hashCode()`
    `java.lang.String` | `toString()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### XName

          public XName(java.lang.String namespace,
                       java.lang.String localname)

      Construct an XName with the given namespace name and local name.
      Parameters:
        `namespace` - A namespace name as a String. A value of null indicate the default namespace.
        `localname` - The local name as a String.

    - #### XName

          public XName(java.lang.String localname)

      Construct an XName with the given local name in the default namespace. This is equivalent to `new XName (null, "somename")`
      Parameters:
        `localname` -

  - ### Method Detail

    - #### getNamespace

          public java.lang.String getNamespace()

      This XName's namespace name, if defined.
      Returns:
        The namespace name of this XName, or null for the default namespace.

    - #### getLocalname

          public java.lang.String getLocalname()

      This XName's local name.
      Returns:
        The local name of this XName.

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © 2025 MarkLogic Corporation

Complete online documentation for MarkLogic Server, XQuery and related components may be found at docs.progress.com