Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cdata sections #59

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Cdata sections #59

wants to merge 5 commits into from

Conversation

NelsonVides
Copy link

@NelsonVides NelsonVides commented Feb 14, 2022

It can happen that some subelement can contain a payload with for example, a big json object. The xml element could be use as an envelope for routing other abstract payloads, and so escaping them could make the blob much bigger for the network transfer, and very unreadable for the debugging eye. So at least make it optional that you want to use cdata escaping when needed.

There's also a couple of "breaking" changes, current code was doing iolist_to_binary for the function called to_iolist, which seems dummy, you might as well call to_binary if you want a binary. iodata usually has a performance advantage improvement for network transmission, so keep iodata as iodata when you want it.

Currently, when printing to binary, exml has an enforced way to
implement escaping, that is, by escaping character by character, which,
in the case of many characters that need escaping, increases the binary
size dramatically, and also makes the binary less readable to the
debugging eye. So we need a mechanism to tell exml to use cdata when
desired.
@codecov-commenter
Copy link

Codecov Report

Merging #59 (62ccc33) into master (3299e97) will increase coverage by 1.83%.
The diff coverage is 92.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #59      +/-   ##
==========================================
+ Coverage   71.49%   73.32%   +1.83%     
==========================================
  Files           7        7              
  Lines        1098     1106       +8     
  Branches      158      160       +2     
==========================================
+ Hits          785      811      +26     
+ Misses        313      295      -18     
Impacted Files Coverage Δ
src/exml_nif.erl 41.66% <ø> (ø)
src/exml.erl 91.42% <90.90%> (ø)
c_src/exml.cpp 94.49% <93.33%> (-0.19%) ⬇️
c_src/rapidxml_print.hpp 59.56% <0.00%> (+10.38%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3299e97...62ccc33. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants