test_SetAttribute_2(FilterSettings.DEFAULT_DOM);
}
public void test_SetAttribute_2(FilterSettings filterSettings) throws IOException, SAXException {
Smooks smooks = new Smooks();
StringResult result = new StringResult();
smooks.setFilterSettings(filterSettings);
smooks.addVisitor(new SetElementData().setAttribute(new QName("http://www.w3.org/2000/xmlns/", "ns1", "xmlns"), "http://ns1").
setAttribute(new QName("http://ns1", "xxx", "ns1"), "${injectedVal}"), "a");
ExecutionContext execContext = smooks.createExecutionContext();
execContext.getBeanContext().addBean("injectedVal", "something");
smooks.filterSource(execContext, new StringSource("<a/>"), result);
XMLUnit.setIgnoreWhitespace( true );
XMLAssert.assertXMLEqual(new StringReader("<a xmlns:ns1=\"http://ns1\" ns1:xxx=\"something\" />"), new StringReader(result.getResult()));
}