txmlnode_setcontent.bmx 485 B

12345678910111213141516171819202122232425262728
  1. SuperStrict
  2. Framework text.xml
  3. Import BRL.StandardIO
  4. Local doc:TxmlDoc = TxmlDoc.newDoc("1.0")
  5. If doc Then
  6. Local root:TxmlNode = TxmlNode.newNode("root")
  7. doc.setRootElement(root)
  8. ' create a new empty node
  9. Local node:TxmlNode = root.addChild("node")
  10. Print node.toString()
  11. ' set the node content
  12. node.setContent("Some text content for the node")
  13. Print node.toString()
  14. ' change the node content
  15. node.setContent("Modified content!")
  16. Print node.toString()
  17. End If