Login   Register  
PHP Classes
elePHPant
Icontem

Node lists

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      DOMIT XML parser  >  All threads  >  Node lists  >  (Un) Subscribe thread alerts  
Subject:Node lists
Summary:Can't get number of node lists as arrays
Messages:1
Author:Shillo
Date:2009-07-14 21:19:04
 

  1. Node lists   Reply  
Picture of Shillo
Shillo
2009-07-14 21:19:04
I have this xml file:
<Module>
<name>Latest News</name>
<description>Shows the latest news of the system.</description>
<author>Facile</author>
<version>1.0</version>
<link>www.facile.co.il</link>
<copyrights>2009 Team Kiwi</copyrights>
<filelist>
<file>bulbul.php</file>
<file>tpl.php</file>
</filelist>
<paramlist>
<param name="amount" value="2" />
<param name="cache" value="false" />
<param name="publish_date" value="Now()" />
</paramlist>
</Module>

And this php code:
$instance = &new DOMIT_Document() ;
$instance->loadXML('somepath.xml');
And when I try to do this:
$files = &$instance->getElementsByPath( "/Module/filelist/file", 0 )->toArray() ;

This works if i put in the parameter 'nodeindex' the argument '1'.
But I'm interested of having the all file tags which are under the filelist tag and convert to array, or at least to a sorted node list so I can loop them.

Thanks,
Shillo.