Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have error as " Fatal error: Call to undefined method DOMDocument::xpath() in C:\xampp\htdocs\myproject "


pls tell me how to search a node in php .. i search as ..

$ModuleValue=$xml->xpath("//Course[Module/Module_id='$value']") ;


my xml is as given below ..


<course>
<login>1
<version>1.2.3.5
<course_id>1
<course_name>physics
<module module_id="1">
<page>1

<module module_id="2">
<page>12

<module module_id="3">
<page>4

Posted
Comments
CHill60 15-Dec-13 12:49pm    
Well that's not xml so any attempt to navigate a DOMDocument that you've loaded that into you will fail
Killzone DeathMan 2-Jan-14 6:31am    
I think that loading with "SimpleXMLElement", then iterating he can do the search engine!
CHill60 2-Jan-14 9:11am    
Could you give him an example of how that might work. I still stand by the fact that the stuff displayed is not XML
Killzone DeathMan 3-Jan-14 11:01am    
I agree with your fact.. Better he shows us the xml content.. something like:
<product>
<name>Test</name>
<value>123</value>
</product>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900