I have a erlang string which may contain characters like & " < and so on:
1> Unenc = "string & \"stuff\" <".
ok
Is there a Erlang function somewhere that parses the string and encodes all the needed HTML/XML entities, such as:
2> Enc = xmlencode(Unenc).
"string & "stuff" <".
?
My use case is for relatively short strings, which come from user input. The output strings of the xmlencode function will be the content of XML attributes:
<company name="Acme & C." currency="€" />
The final XML will be sent over the wire appropriately.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With