/* Ok, so: let's first ensure that local names ARE intern()ed
* when we request them to be:
*/
ifact.setProperty(XMLInputFactory2.P_INTERN_NAMES, Boolean.TRUE);
XMLStreamReader sr = ifact.createXMLStreamReader(new DOMSource(doc));
assertTokenType(START_ELEMENT, sr.next());
assertEquals(ELEM, sr.getLocalName());
assertSame(ELEM, sr.getLocalName());
assertEquals(ATTR, sr.getAttributeLocalName(0));
assertSame(ATTR, sr.getAttributeLocalName(0));
assertEquals(PREFIX, sr.getPrefix());
assertSame(PREFIX, sr.getPrefix());
sr.close();
/* And then also that the impl does honor disabling of
* the feature: while optional, ref. impl. makes this
* easy so there's no excuse not to.
*/
ifact.setProperty(XMLInputFactory2.P_INTERN_NAMES, Boolean.FALSE);
sr = ifact.createXMLStreamReader(new DOMSource(doc));
assertTokenType(START_ELEMENT, sr.next());
assertEquals(ELEM, sr.getLocalName());
// Xerces won't force intern() of element names
assertNotSame(ELEM, sr.getLocalName());