HI. i am having problem with extracting link from empty element tag in xml by using php. i am writing my xml code and pho code. please someone helps me. just put me in th right direction.
php code
<topic id="1HLCM7CDQ-21WQN9G-66">
<instanceOf>
<subjectIndicatorRef xlink:type="simple" xlink:href="http://cmap.coginst.uwf.edu/#concept"/>
</instanceOf>
<baseName>
<baseNameString><![CDATA[feathers]]></baseNameString>
</baseName>
<occurrence>
#this empty element tag is the one from where i am trying to extract the link address as a string but cant
<resourceRef xlink:type="simple" xlink:href="file:/./Birds_concept - about birds/feathers.txt"/>
</occurrence>
</topic>
php code
<html>
<?php
$xml = simplexml_load_file("Birds_concept - about birds.xml");
foreach($xml->topic as $topic) {
These three print's will display the attribute of the <item> (ID), display the first and last name joined together
and then the age. The </br> and <p></p> are for spacing out the results
print "Topic: " . $topic->baseName->baseNameString . "<p></p>";
print "Link: " . $topic->occurrence->resourceRef['xlink:href'];
}
?>
</html>