Note that there are some explanatory texts on larger screens.

plurals
  1. POXml failing to show in table
    primarykey
    data
    text
    <p>I have an XML page <code>holidays.xml</code> and a php page <code>holiday(simplexml).php</code> i am attempting to show details from the XML page in a table on the php page but to no avail, no error messages are given but no content is displayed, could anyone point me in the right direction?</p> <pre><code>&lt;?php // load the xml file into a simplexml instance variable $holiday = simplexml_load_file('holidays.xml'); // draw a table and column headers echo "&lt;table border=\"1\"&gt;"; echo " &lt;th&gt;Title&lt;/td&gt; &lt;th&gt;Link&lt;/td&gt; &lt;th&gt;Description&lt;/td&gt; &lt;th&gt;Published Date&lt;/td&gt; &lt;th&gt;Guid&lt;/th&gt;"; // iterate through the item nodes displaying the contents foreach ($holiday-&gt;item as $holiday) { echo "&lt;tr&gt;"; echo "&lt;td&gt;{$holiday-&gt;title}&lt;/td&gt;"; echo "&lt;td&gt;{$holiday-&gt;link}&lt;/td&gt;"; echo "&lt;td&gt;{$holiday-&gt;description}&lt;/td&gt;"; echo "&lt;td&gt;{$holiday-&gt;pubDate}&lt;/td&gt;"; echo "&lt;td&gt;{$holiday-&gt;guid}&lt;/td&gt;"; echo "&lt;/tr&gt;\n"; } echo "&lt;/table&gt;"; ?&gt; </code></pre> <p>holidays.xml</p> <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt; &lt;rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/"&gt; &lt;channel&gt; &lt;title&gt;Special offers on exotic holidays&lt;/title&gt; &lt;link&gt;http://www.numyspace.co.uk/~cgel1/holidays/special_offers.html&lt;/link&gt; &lt;description&gt;The best site for special offers on exotic holidays. We offer many special offers in the way of holiday discounts, free room upgrades , free flight upgrades and free child places.&lt;/description&gt; &lt;language&gt;en-gb&lt;/language&gt; &lt;pubDate&gt;Sun, 13 Feb 2011 00:00:00 GMT&lt;/pubDate&gt; &lt;image&gt; &lt;title&gt;Special offers for exotic holidays&lt;/title&gt; &lt;link&gt;http://www.numyspace.co.uk/~cgel1/holidays/special_offers.html&lt;/link&gt; &lt;/image&gt; &lt;item&gt; &lt;title&gt;Luxurious Jamaican holidays | 40% Discount On Accommodation - Book Now!&lt;/title&gt; &lt;link&gt;http://www.numyspace.co.uk/~cgel1/holidays/Jamaica.html&lt;/link&gt; &lt;description&gt;7 nights at The Golden Palm, Montego Bay travelling from Newcastle with Fly Jamaica&lt;/description&gt; &lt;pubDate&gt;Sun, 13 Feb 2011 11:58:17 GMT&lt;/pubDate&gt; &lt;guid&gt;http://www.numyspace.co.uk/~cgel1/holidays/Jamaica.html&lt;/guid&gt; &lt;/item&gt; &lt;item&gt; &lt;title&gt;Barbados holidays | Royal Wedding special - Free room upgrade&lt;/title&gt; &lt;link&gt;http://www.numyspace.co.uk/~cgel1/holidays/Barbados.html&lt;/link&gt; &lt;description&gt;10 nights at 5* Pride of Barbados hotel for only £950, travelling on BA from Gatwick&lt;/description&gt; &lt;pubDate&gt;Mon, 14 Feb 2011 13:01:10 GMT&lt;/pubDate&gt; &lt;guid&gt;http://www.numyspace.co.uk/~cgel1/holidays/Barbados.html&lt;/guid&gt; &lt;/item&gt; &lt;/channel&gt; &lt;/rss&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload