Benim dış etiketini kaldırmak olacak bir xpath Xpression almaya çalışıyorum, ama o kaldırıyor, artı iç etiketi ve eleman verileri yazdırma. Nasıl o da benim istemi etiketleri yazdırmak için alabilirim?
My php looks like this:
<?php
#get file
$xml = simplexml_load_file('content.xml') or die ("Unable to load XML string!");
#loop through results
foreach ( $xml->xpath('//prompt') as $voiceQ) {
echo "<h2>Thank you for visiting our site2</h2>";
print $voiceQ;
} //for
?>
My content.xml looks like this
(I'm writing to this file and it's losing some formatting. I don't think this is the problem):
<?xml version="1.0" encoding="UTF-8"?>
<result>
<prompt>
Welcome to Group Finder, Mary Lamb . We see that
you like the group: JackJohnson
</prompt>
</result>
My output looks like this:
Welcome to Group Finder, Mary Lamb . We see that you like the group: JackJohnson
But I want it to look like this:
(just remove result tags):
<prompt>Welcome to Group Finder, Mary Lamb . We see that you like the group: JackJohnson</prompt>