New DOM XML problem
Posted: Wed Mar 02, 2005 8:50 pm
In my file
i have many keywords and by using this code:
i get an error:
Fatal error: Call to a member function on a non-object in /home/user1/public_html/xml/view.php on line 63
Does anyone now how can i modify my code to store the Description.keywords of my choice in an array which i can lately use to show its contents?
Thanks a lot!
Code: Select all
<root>
<Library>
<Creator>alalalalal</Creator>
<Title>lalalalalala</Title>
<Description>Yeap</Description>
<Description.audience>Postgraduate</Description.audience>
<Description.contents>YopYpYopYop</Description.contents>
<Description.keywords>Hi</Description.keywords>
<Description.keywords>He</Description.keywords>
<Description.keywords>Hy</Description.keywords>
<Description.respsite>Soso</Description.respsite>
<Description.url>sisi</Description.url>
<Date.Created>03-03-2005 4:17:51</Date.Created>
<Date.Modified>03-03-2005 4:17:51</Date.Modified>
</Library>
</root>Code: Select all
$i=0;
$keywords = $doc->get_elements_by_tagname("Description.keywords");
$keywords = $keywordsї$i];//i use $i to choose the result
$keywords = $keywords->get_content();//ProblemFatal error: Call to a member function on a non-object in /home/user1/public_html/xml/view.php on line 63
Does anyone now how can i modify my code to store the Description.keywords of my choice in an array which i can lately use to show its contents?
Thanks a lot!