Name
node:contents — Get or set a text node
Synopsis
require('xml');
node:contents(text_str);
Description
When a parameter is passed, a text node with the specified value is created. If no string is passed, the value of the text node is returned. To remove text, pass an empty string.
local node = doc:root(); local child = node:addchild("item"); child:contents("I am a child node.");
Note
In the preceding example, the element node node:contents()
will return the value of the text node of
See Also
Was this page helpful?