Glen Daniels wrote:

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.

yes! i was doing built from codehaus and i forgot to run svn up :(

U  src/com/bea/xml/stream/MXParser.java
U  src/com/bea/xml/stream/ConfigurationContextBase.java
U  src/com/bea/xml/stream/XMLWriterBase.java

please try now. should i cut it as a new version.

thanks,

alek


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



--
The best way to predict the future is to invent it - Alan Kay

Reply via email to