function xml.escape()
Jump to navigation
Jump to search
Escapes XML string to fit xml node contents.
string xml.escape(xmlstring
)
Parameters
- string
xmlstring
string to escape
Return value
string
Escaped characters are
input | output |
---|---|
< | < |
> | > |
" | " |
' | ' |
& | & |
Usage
-- escape string local note = xml.escape("3<5") -- put the escaped string "3<5" into xml node local node = "<note>"..note.."</note>" -- parse the node local result = xml.parse(node) -- check the contents (text is unescaped: "3<5") log(result.text)