DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16330>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16330

Missing xmlns attribut, when serializing element with namespace

           Summary: Missing xmlns attribut, when serializing element with
                    namespace
           Product: Xerces2-J
           Version: 2.2.1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: DOM
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


When running the following program:
import org.w3c.dom.*;
import javax.xml.parsers.*;
import org.apache.xml.serialize.*;
public class XercesTest{
        public static void main(String[] args) throws Exception {
      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
      dbf.setNamespaceAware(true);
      DocumentBuilder db = dbf.newDocumentBuilder();
      Document doc = db.newDocument();
      Element elem = doc.createElementNS("test/namespace", "test");
      elem.setPrefix("tst");
      doc.appendChild(elem);
      XMLSerializer xs = new XMLSerializer(System.out, null);
      xs.serialize(doc);
        }
}

under Xerces-J 2.2.1 (xercesImpl.jar + xml-apis.jar) the result is: 
<?xml version="1.0"?>
<tst:test/>

which is wrong.

When running with Xerces-J 2.0.1 (xerces.jar) the result is:
<?xml version="1.0"?>
<tst:test xmlns:tst="test/namespace"/>

which is correct.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to