Closed Bug 296359 Opened 20 years ago Closed 19 years ago

XMLSerializer doesn't save doctype correctly

Categories

(Core :: XML, defect)

x86
Windows 2000
defect
Not set
major

Tracking

()

VERIFIED DUPLICATE of bug 288133

People

(Reporter: surkov, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; ru-RU; rv:1.7.5) Gecko/20041108 Firefox/1.0 (ax)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; ru-RU; rv:1.7.5) Gecko/20041108 Firefox/1.0 (ax)

XML document stored in file has external DTD. When I load xml file and then save
it then DTD is not saved.

In instance, xml document has DTD:
<!DOCTYPE moduleprefs SYSTEM "chrome://dc-common/locale/js/prefs/prefs.dtd">

After saving xml document has DTD:
<!DOCTYPE >

Reproducible: Always
Example:

var loadurl="file:///c:/mymodule.xml";
var requestor=new XMLHttpRequest();
requestor.open("GET", loadurl, false);
requestor.send(null);
xmldoc=requestor.responseXML;

var saveurl="c:\\mymodule.xml";
var
file=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(saveurl);

var
ostream=Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
ostream.init(file, 0x02|0x20, 0777, null);

var serializer=new XMLSerializer();
serializer.serializeToStream(xmldoc, ostream, "utf-8");
Maybe this behaviour is defined by dom configuration (document.domConfig) but
domConfig is not implemented (https://bugzilla.mozilla.org/show_bug.cgi?id=226193).
Fixed back in May.

*** This bug has been marked as a duplicate of 288133 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.