well-formedness
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reading the reader’s well-formedness checks and the ReaderState handling mentioned in the issue, then compare them with the listed gaps: missing end tags, illegal top-level content, and declarations without content. The issue asks for a broader inventory of unchecked cases and whether a validating reader is feasible; done would require agreeing on scope and behavior, including the stated decision to ignore DTDs.
Written by the indexing model from the issue text.
Description
My understanding is that quick-xml supports reading XML but does not check for all well-formedness errors. It reports a whole bunch of them, but not everything. Since I'm interested in well-formedness I'm curious whether we could have a reader layered over the existing ones that does validate for well-formedness.
I'd like to make an inventory of what's missing:
- while
IllFormedError::MissingEndTagexists it is not actually produced by the reader normally, only ifread_to_endis explicitly called. - putting illegal stuff on the top level such as multiple elements, text nodes, etc. Note that when dealing with XML fragments (as implied here, "fragment" has multiple meanings) it's possible to have multiple elements and text nodes on the top.
- having a declaration without content is currently accepted
What other aspects of well-formedness did I miss that quick-xml currently does not check for? There are a whole cluster of them around entities, but I'm okay with ignoring DTDs entirely.
To implement checking whether tags are balanced, some kind of stack of which tags have been opened needs to be maintained. When considering how to do this efficiently I noticed that the internal ReaderState appears to maintain an efficient structure to track which elements have been started but not ended yet. But I don't think that's exposed to the outside world, is it? Could this indeed be useful for this?
Am I correct that quick-xml is pretty close in providing all the pieces already?
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 299
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tafia/quick-xml
-
Parser accepts an empty element or attribute namePossibly taken @ychampion claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
DecodingReader::set_encoding panics when the XML declaration is longer than 64 bytesPossibly taken @emschwartz claimed this 4 days ago. Openbug encoding
Difficulty 4/5 3-5 days Newbie friendliness 30/100
tafia/quick-xml#1040 · 1 comment ·
Maintainers usually reply within 1 day
-
encoding optimization
Difficulty 4/5 3-5 days Newbie friendliness 55/100
tafia/quick-xml#1039 · 1 comment ·
Maintainers usually reply within 1 day
-
optimization question
Difficulty 4/5 3-5 days Newbie friendliness 52/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 1-2 days Newbie friendliness 53/100
tafia/quick-xml#1035 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
storytold/photocraft#14822 ·
Maintainers usually reply within 1 day
-
bug css
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
dginev/latexml-oxide#853 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 2 days
-
[Bug] export_build_environment admits its output directory only after the export ran in the build computerPossibly taken @viniciusdsandrade claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day