namespace | Apache Ivy™ Documentation

# namespace Tag: namespace Defines a new namespace. A namespace is identified by a name, which can be referenced by one of the resolvers. An overview of namespaces is given in the namespaces documentation. A namespace mainly consists of a list of rules, each rule defining a translation between a system namespace and the defined namespace, and vice versa. There are two main possibilities for using these rules. By default, a namespace iterates through the rules, and when it finds one that translates the given name, it returns the translated name. But the namespace can be configured to use the list as a translator chain: in this case, all rules are applied in order, the result of the first rule translation being passed to the second, and so on. ## Attributes
Attribute | Description | Required
--- | --- | ---
name | the namespace name | Yes
chainrules | true to indicate that namespaces rules should be chained, false otherwise | No, defaults to false
## Child elements
Element | Description | Cardinality
--- | --- | ---
rule | defines a new namespace rule | 0..n
## Example
    <namespace name="test">
      <rule>
        <fromsystem>
          <src org="systemorg"/>
          <dest org="A"/>
        </fromsystem>
        <tosystem>
          <src org="A"/>
          <dest org="systemorg"/>
        </tosystem>
      </rule>
    </namespace>
    <namespace name="test">
      <rule>
        <fromsystem>
          <src org="systemorg2" module="system\-(.+)"/>
          <dest org="B" module="$m1"/>
        </fromsystem>
        <tosystem>
          <src org="B" module=".+"/>
          <dest org="systemorg2" module="system-$m0"/>
        </tosystem>
      </rule>
    </namespace>
    <namespace name="test" chainrules="true">
      <rule>
        <fromsystem>
          <src org="systemorg"/>
          <dest org="A"/>
        </fromsystem>
        <tosystem>
          <src org="A"/>
          <dest org="systemorg"/>
        </tosystem>
      </rule>
      <rule>
        <fromsystem>
          <src module="systemmod"/>
          <dest module="A"/>
        </fromsystem>
        <tosystem>
          <src module="A"/>
          <dest module="systemmod"/>
        </tosystem>
      </rule>
      <rule>
        <fromsystem>
          <src module="systemmod2"/>
          <dest module="B"/>
        </fromsystem>
        <tosystem>
          <src module="B"/>
          <dest module="systemmod2"/>
        </tosystem>
      </rule>
    </namespace>