You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Sunday, December 9th 2007, 9:10pm

Konqueror/JavaScript and invalid XML serialization

Hi all,
Consider code under Konqueror.

Source code

1
2
3
4
var p = new DOMParser();
var doc =  p.parseFromString("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<action/>", "text/xml")
var s = new XMLSerializer()
alert(s.serializeToString(doc))


The function 'serializeToString(..)' create an invalid XML document. An "\n" is missing after the XML declaration.

I'm using Konqueror 3.5.8 under Kubuntu 64 bits.

Does this issue is known ?

Is there an another way to create a new XML document with a custom XML declaration without parsing a string like the code above ?


TIA

/greg