Closed
Bug 127300
Opened 23 years ago
Closed 23 years ago
XML serializer doesn't generate XML prolog
Categories
(Core :: DOM: Serializers, defect)
Tracking
()
People
(Reporter: adamlock, Assigned: t_mutreja)
References
()
Details
The XML serializer (nsXMLContentSerializer.cpp) doesn't generate valid XML,
missing out the <?xml version="1.0"?> at the beginning and probably more besides.
Steps to reproduce:
Load an XML page (see above for sample)
Choose "Save Page As..." to save the page as XML
Note that the webbrowser persist object is saving the file as text/xml and the
XML serializer is being invoked.
Comment 2•23 years ago
|
||
When this bug is fixed, will complete page saving not corrupt the XHTML when
saving my page? (http://turbogeek.org).
The XML content serializer is used for XHTML:
http://lxr.mozilla.org/seamonkey/source/content/build/nsContentModule.cpp#686
So in theory, yes.
Missing the XML declaration does not automatically invalidate the document; if
the document uses some strange charset that is a problem. And this is not a bug
in the serializer, because we do not put the declaration in the DOM in the first
place (so the serializer has nothing to serialize). That part is a dupe of some
bug I can't find now.
Please specify what other issues you are seeing. Is it bug 126669?
I've looked at the XML spec and it uses the word "should" for generating the
prolog. Optional but recommended.
Unless we have some reason not to generate it, I believe it should happen.
I'll rename this bug to cover that one issue.
Summary: XML serializer doesn't generate valid XML → XML serializer doesn't generate XML prolog
We do output the prolog; we do not output the XML declaration. It is not in the
DOM, but we should be able to store it in the document and then output that info
from the document.
*** This bug has been marked as a duplicate of 63558 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•