title: java Get the list or name of all attributes in a XML element
body: <p>i have an xml element</p>
  
  <pre><code>   &lt;base baseAtt1="aaa" baseAtt2="tt"&gt;
          &lt;innerElement att1="one" att2="two" att3="bazinga"/&gt;
     &lt;/base&gt;
  </code></pre>
  
  <p>and i would like to get the list of attributes.
  for <strong>both</strong> the base element and the inner element.</p>
  
  <p>i <strong>dont know</strong> the name of the innerElement
   it can have many different names.</p>
  
  <pre><code> NodeList baseElmntLst_gold  = goldAnalysis.getElementsByTagName("base");
   Element baseElmnt_gold = (Element) baseElmntLst_gold.item(0);
  </code></pre>
  
  <p>the goal is to get a kind of dictionary as output,</p>
  
  <p>for example for the xml above the output will be a dictionary with those valuse.</p>
  
  <pre><code>baseAtt1 = "aaa"
  baseAtt2 = "tt"
  att1 = "one"
  att2 = "two"
  att3 = "bazinga"
  </code></pre>
  
  <p>i am using jre 1.5</p>