feat(std/xml): Xml.encode, Xml.tree and XmlEncoder #637
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/605-xml-encode"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #605
Summary
Step 3b of epic #78.
XmlEncoderbuilds anXmlNodedocument from anyEncodevalue;Xml().encodewrites it as text,Xml().treereturns the tree. Mapping per the issue's Decisions (record = element, Option left out, list = repeated elements, naming, indent, escaping, unwritable cases with messages). Docs (xml.md, ENCODING.md section 14 row 8 and point 18) and skills updated.Format<XmlError>stays step 3c.Notes
Bytesfield derived through Encode encodes as a list of ints; base64 applies wherebytes()is called (unit-tested directly).Verification
Locally on the nightly VM: encoder tests 20 pass, encode tests 13 pass, std/xml/tests 541 passed 0 failed;
torb format --checkclean;docs skill --checkup to date. Full gates run in forge CI.Xml.encodewrites a typed value as an XML document (step 3b of #78) #605Xml.encodewrites a typed value as an XML document (step 3b of #78) #605Xml.encodewrites a typed value as an XML document (step 3b of #78) #605Review of
d6e06f0(closes #605): approved.bytes(), naming (Pascal/Snake), indent, escaping, each unwritable case with its message, round trip, exact S3 CompleteMultipartUpload text. CI green for this head (gates, tier A, bootstrap, pdisc, commit messages).nothing()handles field, map entry and list item separately;completerejects a list inside a list; errors carry line 0 and the field chain; the root is checked for a record and a valid XML name.Format<XmlError>is left to step 3c; no attributes or namespaces.XmlEncoderinside std/xml, the layout ofTomlEncoder; the seed is not touched.Non-blocking:
Bytesfield through the derivedEncodeis a list of ints, as the PR body says. TheXml.encodedoc comment (std/xml/src/xml.trb) and ENCODING.md point 18 still say flatly "Bytesas base64"; xml.md has the accurate wording ("handed to the encoder as bytes"). Align them, and consider a follow-up issue for the derive path, whichTomlEncodershares.FloatNaN/Infinity are written as their text (NaN);Xml.decodemay not read them back. Worth a line in the docs or a follow-up.