Howdy,
I have the following code and I would like just to fetch the "text" using xpath:
$xml="<document>text</document>";
$doc=xmldoc($xml);
$ctx=xpath_new_context($doc);
$foo=xpath_eval($ctx,"//*");
echo "<pre>";
print_r($foo);
echo "</pre>";
This outputs the results that may be seen on http://www.teendate.de/bsp/test.php.
Can someone show me how I would fetch the "text"?
And how would I go if I would like to fetch the text1 and text2 if $xml would be like this:
$xml="<document><title>my title</title><body><para>text1</para><para>text2</para></body></document>";
Thanks a lot in advance! I hope this makes sense to someone! 🙂
CU
Sarah