title: XMLStreamWriter missing exceptions?
body: <p>I'm currently looking into writing a loose port of XMLStreamWriter to another environment, and trying to get a handle on its namespace logic. <a href="http://docs.oracle.com/javase/8/docs/api/javax/xml/stream/XMLStreamWriter.html" rel="nofollow">Oracle's documentation</a> for this class seems to specify that with namespace repairing disabled, attempting to write an element/attribute using a namespace URI already bound to some prefix, using a <em>different</em> prefix, should cause an XMLStreamException. But I don't see this behaviour. With the following code:</p>
  
  <pre><code>public void run() throws Exception {
      String BOB = "http://www.bob.com/"
      XMLOutputFactory fac = XMLOutputFactory.newInstance();
      fac.setProperty("javax.xml.stream.isRepairingNamespaces", false); // default
      XMLStreamWriter writer = fac.createXMLStreamWriter(new FileWriter("tst.xml"));
  
      writer.writeStartElement("bob", "root", BOB);
      writer.setPrefix("bob", BOB);
      writer.writeNamespace("bob", BOB);
      writer.writeAttribute("notbob", BOB, "attr", "value"); // Should fail?
      writer.writeStartElement("notbob", "firstinner", BOB); // Should fail?
      writer.writeEndElement();
      writer.writeEndElement();
      writer.writeEndDocument();
  
      writer.flush();
      writer.close();
  }
  </code></pre>
  
  <p>I would expect both lines using the <code>"notbob"</code> prefix for the same namespace URI already bound to <code>"bob"</code> to throw exceptions. Instead, the code completes normally, and <code>tst.xml</code> contains</p>
  
  <pre><code>&lt;bob:root xmlns:bob="http://www.bob.com" notbob:attr="value"&gt;
      &lt;notbob:firstinner&gt;&lt;/notbob:firstinner&gt;
  &lt;/bob:root&gt;
  </code></pre>
  
  <p>Am I misunderstanding, or is this behaviour incorrect?</p>