Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialization of the XML declaration #50

Open
Ms2ger opened this issue Apr 2, 2019 · 0 comments
Open

Serialization of the XML declaration #50

Ms2ger opened this issue Apr 2, 2019 · 0 comments

Comments

@Ms2ger
Copy link

Ms2ger commented Apr 2, 2019

<!DOCTYPE html>
...<script>
var input = '<?xml version="1.0" encoding="windows-1252"?><root><child1>value1</child1></root>';
var parser = new DOMParser();
var doc = parser.parseFromString(input, 'text/xml');
w(new XMLSerializer().serializeToString(doc))
</script>

logs:

<?xml version="1.0" encoding="UTF-8"?>
<root><child1>value1</child1></root>

in Firefox,

<?xml version="1.0" encoding="windows-1252"?><root><child1>value1</child1></root>

in Chrome and WebKit, and

<root><child1>value1</child1></root>

per spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants