dom option ?arg arg ...?
parses the XML in the variable xml, creates the DOM tree in memory, make a reference to the document object, visible in Tcl as a document object command, and assigns this new object name to the variable doc. When doc gets freed, the DOM tree and the associated Tcl command object (document and all node objects) are freed automatically.dom parse $xml doc $doc documentElement root
parses the XML in the variable xml, creates the DOM tree in memory, make a reference to the document object, visible in Tcl as a document object command, and returns this new object name, which is then stored in document. To free the underlying DOM tree and the associative Tcl object commands (document + nodes + fragment nodes) the document object command has to be explicitly deleted by:set document [dom parse $xml] set root [$document documentElement]
If -simple is specified, a simple but fast parser is used (conforms not fully to XML recommendation). That should double parsing and DOM generation speed. UTF-8 is not generated internally with that parser. If -keepEmpties is specified, text nodes, which contain only whitespaces, will be part of the resulting DOM tree. In default case (-keepEmpties not given) those empty text nodes are removed at parsing time.$document delete or rename $document ""