title: TCL tDom Empty XML Tag
body: <p>I'm using tDom to loop through some XML and pull out each element's text().</p>
  
  <pre><code>    set xml {
  &lt;systems&gt;
   &lt;object&gt;
    &lt;type&gt;Hardware&lt;/type&gt;
    &lt;name&gt;Server Name&lt;/name&gt;
    &lt;attributes&gt;
     &lt;vendor&gt;&lt;/vendor&gt;
    &lt;/attributes&gt;
   &lt;/object&gt;
   &lt;object&gt;
    &lt;type&gt;Hardware&lt;/type&gt;
    &lt;name&gt;Server Two Name&lt;/name&gt;
    &lt;attributes&gt;
     &lt;vendor&gt;&lt;/vendor&gt;
    &lt;/attributes&gt;
   &lt;/object&gt;
  &lt;/systems&gt;
  };
  
      set doc  [dom parse $xml]
      set root [$doc documentElement]
  
      set nodeList [$root selectNodes /systems/object]
  
      foreach node $nodeList {
  
       set nType  [$node selectNodes type/text()]
       set nName  [$node selectNodes name/text()]
       set nVendor [$node selectNodes attributes/vendor/text()]
  
       # Etc...
       puts "Type: " 
       puts [$nType data] 
  
       # Etc ..
  
       puts [$nVendor data]
      }
  </code></pre>
  
  <p>But when it tries to print out the Vendor, which is empty, it thows the error invalid command name "".  How can I ignore this and just set $nVendor to an empty string?</p>