writeStartElement has prvoide namespaceURI, why need another writeNamespace?
The code:
    XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
    XMLStreamWriter writer = outputFactory.createXMLStreamWriter(System.out);
    writer.writeStartDocument("1.0");
    writer.writeCharacters("\n");
    writer.writeStartElement("ns1", "sample", "http://www.e.com/ns1");
    writer.writeNamespace("ns1", "http://www.e.com/ns1");
    writer.writeEndElement();
    writer.writeEndDocument();
The result is:
<?xml version="1.0"?>
<ns1:sample xmlns:ns1="http://www.e.com/ns1"/>

If I delelte "writer.writeNamespace("ns1", "http://www.e.com/ns1");"
the result is
<?xml version="1.0"?>
<ns1:sample/>

What's the affect of the namespaceURI parameter of writeStartElement()?

writeStartElement has prvoide namespaceURI, why need another writeNamespace?
===

The code:
    XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
    XMLStreamWriter writer = outputFactory.createXMLStreamWriter(System.out);
    writer.writeStartDocument("1.0");
    writer.writeCharacters("\n");
    writer.writeStartElement("ns1", "sample", "http://www.e.com/ns1");
    writer.writeNamespace("ns1", "http://www.e.com/ns1");
    writer.writeEndElement();
    writer.writeEndDocument();
The result is:
<?xml version="1.0"?>
<ns1:sample xmlns:ns1="http://www.e.com/ns1"/>

If I delelte "writer.writeNamespace("ns1", "http://www.e.com/ns1");"
the result is
<?xml version="1.0"?>
<ns1:sample/>

What's the affect of the namespaceURI parameter of writeStartElement()?
