}
@Test
public void namespaced_elements_and_attributes()
{
MarkupWriter w = new MarkupWriterImpl(new XMLMarkupModel());
Element root = w.elementNS("fredns", "root");
assertSame(root.defineNamespace("fredns", "fred"), root);
root.defineNamespace("barneyns", "barney");
assertSame(w.attributeNS("fredns", "foo", "bar"), root);
Element child = w.elementNS("barneyns", "child");
assertSame(child.getContainer(), root);
w.end(); // child
w.end(); // root
assertEquals(
w.toString(),
"<?xml version=\"1.0\"?>\n<fred:root fred:foo=\"bar\" xmlns:barney=\"barneyns\" xmlns:fred=\"fredns\"><barney:child/></fred:root>");
}