title: Can't register namespace with XMLUnit
body: <p>I can't seem to work out how to set namespace when comparing XML's using xmlunit-2</p>
  
  <p>Tried like:</p>
  
  <pre><code>   @Test
      public void testDiff_withIgnoreWhitespaces_shouldSucceed() {
          // prepare testData
          String controlXml = "&lt;a&gt;&lt;text:b&gt;Test Value&lt;/text:b&gt;&lt;/a&gt;";
          String testXml = "&lt;a&gt;\n &lt;text:b&gt;\n  Test Value\n &lt;/text:b&gt;\n&lt;/a&gt;";
          Map&lt;String, String&gt; namespaces = new HashMap&lt;String, String&gt;();
          namespaces.put("text","urn:oasis:names:tc:opendocument:xmlns:text:1.0");
          // run test
          Diff myDiff = DiffBuilder.compare(Input.fromString(controlXml).build())
                        .withTest(Input.fromString(testXml).build())
                        .withNamespaceContext(namespaces)
                        .ignoreWhitespace()
                        .build();
  
          // validate result
          Assert.assertFalse("XML similar " + myDiff.toString(), myDiff.hasDifferences());
  
      }
  </code></pre>
  
  <p>but always get</p>
  
  <blockquote>
    <p>org.xmlunit.XMLUnitException: The prefix "text" for element "text:b"
    is not bound.</p>
  </blockquote>
  
  <p>stripping away the namespace prefix from elements make it work, but I would like to learn how register properly the namespace with <code>DiffBuilder</code>. </p>
  
  <p>The same problem/ignorence I experience with <code>xmlunit-1.x</code> so hints using that library I would appreciate as well.</p>
  
  <p>EDIT, based on the answer</p>
  
  <p>By adding the namespace attribute to the root node I managed to bind the namespace</p>
  
  <p><code>&lt;a xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"&gt;</code></p>
  
  <p>thanks Stefan</p>