"\"@xmlns\" : { " +
"\"charlie\" : \"http:\\/\\/some-other-namespace\", " +
"\"$\" : \"http:\\/\\/some-namespace\"" +
"} " +
"} }");
AbstractXMLStreamReader reader = new BadgerFishXMLStreamReader(obj);
assertEquals(XMLStreamReader.START_ELEMENT, reader.next());
assertEquals("alice", reader.getName().getLocalPart());
assertEquals(XMLStreamReader.START_ELEMENT, reader.next());
assertEquals("bob", reader.getLocalName());
assertEquals(0, reader.getAttributeCount());
assertEquals(2, reader.getNamespaceCount());
// assertEquals("http://some-namespace", reader.getNamespaceURI(0));
// assertEquals("", reader.getNamespacePrefix(0));
assertEquals("http://some-namespace", reader.getNamespaceURI(""));
// assertEquals("http://some-other-namespace", reader.getNamespaceURI(1));
// assertEquals("charlie", reader.getNamespacePrefix(1));
assertEquals("http://some-other-namespace", reader.getNamespaceURI("charlie"));
assertEquals(XMLStreamReader.CHARACTERS, reader.next());
assertEquals("david", reader.getText());
assertEquals(XMLStreamReader.END_ELEMENT, reader.next());
assertEquals("bob", reader.getName().getLocalPart());
// ----
assertEquals(XMLStreamReader.START_ELEMENT, reader.next());
assertEquals("edgar", reader.getLocalName());
assertEquals("charlie", reader.getPrefix());
assertEquals("http://some-other-namespace", reader.getNamespaceURI());
assertEquals(0, reader.getAttributeCount());
assertEquals(2, reader.getNamespaceCount());
// assertEquals("http://some-namespace", reader.getNamespaceURI(0));
// assertEquals("", reader.getNamespacePrefix(0));
assertEquals("http://some-namespace", reader.getNamespaceURI(""));
// assertEquals("http://some-other-namespace", reader.getNamespaceURI(1));
// assertEquals("charlie", reader.getNamespacePrefix(1));
assertEquals("http://some-other-namespace", reader.getNamespaceURI("charlie"));
assertEquals(XMLStreamReader.CHARACTERS, reader.next());
assertEquals("frank", reader.getText());
assertEquals(XMLStreamReader.END_ELEMENT, reader.next());
assertEquals("edgar", reader.getName().getLocalPart());
assertEquals(XMLStreamReader.END_ELEMENT, reader.next());
assertEquals("alice", reader.getName().getLocalPart());
}