Parsing xml file using xpath and xquery

Progs4Arab

New Member
I have a xml file\[code\]<?xml version="1.0" encoding="UTF-8"?><xml><settings><title>Calendar for September</title><subTitle>Calendar for September Calendar for September</subTitle></settings><events date="06-09-2010"><event id="2"><title>This is My Second Event</title><description>This is My Second Event </description></event><event id="3"><title>This is My Third Event </title><description>This is My Third Event This is My Third Event This is My Third Event </description></event></events></xml>\[/code\]I am parsing the xml file using \[code\]$xml_str = file_get_contents('xmlfile');$xml = simplexml_load_string($xml_str);if(!empty($xml)){ $nodes = $xml->xpath('//xml/events/event[@id="'.$id.'"]');}\[/code\]It will give only the title and description of event tag with specified id.How i can get the date
 
Back
Top