public void testAdditionalNamespaces()
throws Exception
{
String xml = "<a xmlns:a='aNS'><a:b/></a>";
Map map = new SequencedHashMap();
map.put("b", "bNS");
map.put("c", "cNS");
map.put("a", "not-aNS");
XmlOptions options = new XmlOptions();
options.setLoadAdditionalNamespaces(map);
XmlObject x = XmlObject.Factory.parse(xml, options);
// 'a' prefix namespace is not remapped
String expect = "<a xmlns:c=\"cNS\" xmlns:b=\"bNS\" xmlns:a=\"aNS\"><a:b/></a>";
Assert.assertEquals( expect, x.xmlText() );
xml = "<a xmlns='aNS'><b/></a>";
map = new SequencedHashMap();
map.put("b", "bNS");
map.put("c", "cNS");
map.put("", "not-aNS");
options = new XmlOptions();
options.setLoadAdditionalNamespaces(map);
x = XmlObject.Factory.parse(xml, options);