txmlnode_unsetattribute.bmx 514 B

1234567891011121314151617181920212223242526272829
  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. ' add some attributes
  12. node.setAttribute("attr1", "Attribute value")
  13. node.setAttribute("attr2", "Another value")
  14. Print node.toString()
  15. ' remove an attribute
  16. node.unsetAttribute("attr1")
  17. Print node.toString()
  18. End If