You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2003/01/22 15:40:47 UTC
DO NOT REPLY [Bug 16330] New: -
Missing xmlns attribut, when serializing element with namespace
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: xerces-j-dev@xml.apache.org
ReportedBy: frode-mjos.johnsen@edbtelesciences.com
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: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org