title: foreach with Joomla 1.7 XMLParser
body: <p>I've tried looking for an answer in other places but the documentation on XMLParser in Joomla is really poor. Basically, I'm just trying to extract data from nodes in a XML file. If anyone could explain to me what is wrong with my syntax I would appreciate it:</p>
  
  <pre><code>$path    = "uploaded_xmls/" . $_FILES["file"]["name"];
  
          $xml =&amp; JFactory::getXMLParser('Simple');
  
          $user = &amp; JFactory::getUser();
  
          if($user-&gt;id &amp;&amp; $xml-&gt;loadFile($path)) {            
              foreach( $xml-&gt;document-&gt;track as $track ) {
                  $track_id = $track-&gt;getElementByPath('id');
                  $track_type = 's';              
              }
              }
  </code></pre>