@Test
public void testGetNamespaceResolverFromBrokenXml_out_scope() throws Exception {

    final NamespaceResolver nsResolver = getNamespaceResolverFromBrokenXml("" +
            "<root xmlns:a='aaa' xmlns:b='bbb'>" +
            "<foo xmlns:b='bbb2'></foo>" +
            "<bar");
    assertEquals(nsResolver.getURIForPrefix("a", false), "aaa");
    assertEquals(nsResolver.getURIForPrefix("b", false), "bbb");
    assertNull(nsResolver.getURIForPrefix("c", false));
}