You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reader does not normalize \r\n/\r line endings or literal whitespace in attribute values (XML 1.0 §2.11, §3.3.3) #9
stax-xml readers and stax-xml/converter return raw \r\n and \r in parsed content and raw literal \t, \n, and \r\n in attribute values instead of applying XML 1.0 end-of-line handling (§2.11) and attribute-value whitespace normalization (§3.3.3).
Reproduction (npm init -y && npm pkg set type=module && npm i stax-xml@1.1.2 && node repro.mjs):
Expected output (\r\n and lone \r normalized to \n before parsing per §2.11, and literal \t, \r, \n in attribute values replaced with ' ' while character references 	, , are preserved per §3.3.3):
In packages/stax-xml/src/core/TokenCursor.ts, text() and attributeValue() slice raw buffer spans and pass them straight to decodeEntities() without normalizing line endings or replacing literal whitespace in attribute values (the same happens for Uint8Array and async EventReader/StreamReader inputs).
Tested on stax-xml@1.1.2 (npm latest) and master at 07cca8a0f53f83a47de4149f84749e4259dc9360 with Node.js v26.13.0.
Thanks for precise issue. CRLF normalization issue is resolved in #10 . At that PR, I added w3c expected result tests also(previously chekcs only pass or fail).
Patch version will be published to npm soon.
Activity
Clickin commentedon Nov 16, 2026
Thanks for precise issue. CRLF normalization issue is resolved in #10 . At that PR, I added w3c expected result tests also(previously chekcs only pass or fail).
Patch version will be published to npm soon.