@Test public void clear() { context.bindNamespaceUri("prefix1", namespaceUri); context.bindNamespaceUri("prefix2", namespaceUri); context.bindNamespaceUri("prefix3", additionalNamespaceUri); context.clear(); assertThat("All bound prefixes were removed", context.getBoundPrefixes().hasNext(), is(false)); assertThat("All bound namespace URIs were removed", context.getPrefixes(namespaceUri).hasNext(), is(false)); }
public final void startDocument() throws SAXException { namespaceContext.clear(); namespaceContextChanged = false; try { startDocumentInternal(); } catch (XMLStreamException ex) { throw new SAXException("Could not handle startDocument: " + ex.getMessage(), ex); } }
public final void endDocument() throws SAXException { namespaceContext.clear(); namespaceContextChanged = false; try { endDocumentInternal(); } catch (XMLStreamException ex) { throw new SAXException("Could not handle startDocument: " + ex.getMessage(), ex); } }