Braintree v0.6.0 Braintree.XML.Entity

Summary

Functions

Replace any escaped HTML entities with the unicode value

Encode all illegal XML characters by replacing them with corresponding entities

Functions

decode(string)

Replace any escaped HTML entities with the unicode value.

Examples

iex> Braintree.XML.Entity.decode("<tag>")
"<tag>"

iex> Braintree.XML.Entity.decode("S&#248;ren")
"Søren"

iex> Braintree.XML.Entity.decode("Normal")
"Normal"
encode(string)

Encode all illegal XML characters by replacing them with corresponding entities.

Examples

iex> Braintree.XML.Entity.encode("<tag>")
"&lt;tag&gt;"

iex> Braintree.XML.Entity.encode("Here & There")
"Here &amp; There"