w3c / w3c/DOM-Parsing

Serialization of the XML declaration

Open
#50 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

xml-serialization
Dominant language
HTML
Stars
28
Forks
14
Avg merge
3h 10m
Merged PRs (30d)
1

Description

<!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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the DOMParser/XMLSerializer example in the issue and compare the Firefox, Chrome/WebKit, and specification outputs. Trace the serialization behavior in the DOM Parsing and Serialization project, then verify that the XML declaration encoding matches the specified result across the reported case.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript
Domain
web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.