Reader should be capable of transparent EOL normalization
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Start by tracing the Reader constructors and the XML content methods mentioned in the issue, then read XML 1.0 Section 2.11 and the linked follow-up issue. The proposed change spans buffering, decoding, normalization, zero-copy behavior, and compatibility for noncompliant input; define the desired API and tradeoffs before implementation. Done means reader behavior follows the selected XML specification consistently, with an explicit approach for disabling normalization where needed.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Followup to https://github.com/tafia/quick-xml/issues/158
Per XML specification, all XML readers should perform line-ending normalization as a pre-processing step (or functionally behaving as if it were a pre-processing step - XML 1.0 Section 2.11)
This is both an ergonomic issue and also a minor correctness issue, because EOL normalization is blind to document contents and therefore also applies within elements, e.g. <?xml\r?> ought to be parsed as <?xml\n?> - which libxml2 does in fact do.
It's an ergonomic issue in the sense that a user should not need to care about it - the .xml_content(), .xml10_content(), .xml11_content() functions etc. ought to be superfluous and are potentially error prone. The user also shouldn't need to track the version declared in the declaration - they likely just want the document to be processed according to the correct specification per the declaration or according to the one they specify, but that need not change on a per-element basis.
Performing universal EOL normalization as a pre-processor pass through a bufffer would reduce total allocations and likely improve performance on average, while improving ergonomics and compliance.
The mechanism could also likely be used as a base upon which line/column tracking (https://github.com/tafia/quick-xml/issues/109) could be added.
Potentially troublesome aspects:
- For users who process noncompliant "almost-XML" documents that contain binary blobs, we would need a way to disable it, possibly document-wide, or perhaps just during the usage of
stream(). - We might want to make the current Reader constructors
from_reader(),from_str(),from_bytes()methods buffered by-default, and perhaps add a new constructor which takes only a pre-processedXmlDoctype or similar where decoding + normalization has already happened, allowing proper zero-copy. If we keep zero-copy (which isn't really zero-copy in practice) at all - maybe worth doing some benchmarking to see how much time is actually saved vs. just having a buffered path. XML parsing is easily 25-50x slower than copying the bytes around once or twice anyway, and theXmlSourcecode + macros are all quite complex.
- Lingua principale
- Rust
- Stelle
- 1.6k
- Fork
- 299
- Merge medio
- 2g 4h
- PR unite (30g)
- 9
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di tafia/quick-xml
-
Parser accepts an empty element or attribute nameForse già presa @ychampion l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
DecodingReader::set_encoding panics when the XML declaration is longer than 64 bytesForse già presa @emschwartz l’ha presa 4 giorni fa. Apertabug encoding
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
tafia/quick-xml#1040 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
encoding optimization
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
tafia/quick-xml#1039 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
optimization question
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 4/5 1-2 giorni Idoneità per principianti 53/100
tafia/quick-xml#1035 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di tafia/quick-xml
Issue simili
-
[Bug]: opencode_go chat route drops reasoning_effort (even 'none'), while the same endpoint honors it via custom_llm_provider=openaiForse già presa @arvindkumar-ship-it l’ha presa oggi. Apertallm translation
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
BerriAI/litellm#51871 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
comp-formats
Difficoltà 2/5 Mezza giornata Idoneità per principianti 64/100
ClickHouse/ClickHouse#131694 ·
I maintainer di solito rispondono entro 1 giorno
-
cli: `execCargoMetadata` decodes stdout per chunk, corrupting non-ASCII paths across pipe boundariesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
C-Bug S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bevyengine/bevy#26558 ·
I maintainer di solito rispondono entro 2 giorni