servo / servo/html5ever

Add XML fragment parsing to xml5ever

Open
#271 12 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

XML
Dominant language
Rust
Stars
2.6k
Forks
288
Avg merge
2d 22h
Merged PRs (30d)
8

Description

Since I deleted the xml5ever repostiory, I've decided to move this issue here. This was a feature @nox asked, and it seems that it's a pain point in servo as well see servo/servo#11995.

The algorithm for parsing xml fragment is in HTML5 spec.

Basically, what's needed is to construct a context element with given name, a NamespaceMap, and input string.
It's advised to use parse_fragment from h5e as reference point.

Contributor guide

No contributing guide indexed for this repository

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

Read the XML fragment algorithm in the HTML5 spec, then use html5ever/src/driver.rs and its parse_fragment entry point as the reference. Inspect xml5ever/src/tree_builder/mod.rs for NamespaceMap and determine the context element and input-string path; done means xml5ever supports parsing XML fragments for a supplied context.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.