How do I reference specific xml elements?
Based on a form post, I want to access the values of certain elements,
and echo that result.
The xml file would contain many elements with an tag.
So in the example below, I would like to access the description value where
id=1a:
<task>
<group>mygroup</group>
<id>1a</id>
<description>New forum for mygroup</description>
<duration>1:00</duration>
<app>php</app>
<dependency>Time</dependency>
<resource>techteam</resource>
<comments>use this id to get data needed</comments>
</task>
I am using simplexml_load_file, and then trying to access specific elements based on a form post.
For example:
[php]
$myapps = ($_POST[apps]);
$xml = simplexml_load_file("…/xml/tasks.xml");
if (in_array(‘Example Form Item’,$myapps))
echo $xml->task-> then what?
[/php]