Hi Alek:

i have just rebuilt RI and the latest 1.1.2 version is in http://dist.codehaus.org/stax/jars/

Unfortunately this version still seems to have problems with multiple namespaces when repairing is switched on. :( The version that I get when I maven from the SVN source that I picked up yesterday works great, but the one you refer to above doesn't.

Try the Axis2 test org.apache.axis2.om.AttrNsTest (in the xml module) with repairing namespaces switched on (uncomment line 89 in org.apache.axis2.om.impl.OMOutputImpl) to see the problem.

Another problem can be seen with this code:

  XMLOutputFactory xmlOutputFactory = XMLOutputFactory.newInstance();
  xmlOutputFactory.setProperty("javax.xml.stream.isRepairingNamespaces",
                               Boolean.TRUE);
XMLStreamWriter writer = xmlOutputFactory.createXMLStreamWriter(System.out);
  writer.writeStartElement("http://ns1";, "foo");
  writer.writeNamespace("d", "http://ns1";);
  writer.writeEndElement();
  writer.flush();

This produces (using the version up on codehaus):

<ns1:foo xmlns:d="http://ns1"; xmlns:d="http://ns1";></ns1:foo>

Clearly the namespace is being output twice (and you'll also note that your empty element optimization isn't present), but there is also another problem in that the "ns1" prefix isn't actually being defined! The latter problem, by the way, still exists even in the SVN code.

--Glen

Reply via email to