Hi,
I am using simpleXML and I want to loop though the feed to only display 5 shows using the position() method, but have no joy in getting it to work
foreach($xml->sortedXPath('TV[position() < 5 and ProgrammeName="MTV"]', 'TransmissionDate', SORT_DESC) as $i => $item)
{
print "<a href='?v=".$item->ID."&a=false' class='link'>\n";
...
Using simpleDom.php to parse an xml file works fine in windows but failsin unix .
<br />
<b>Fatal error</b>: Uncaught exception 'InvalidArgumentException' with message 'chunk is not well balanced
' in SimpleDOM.php:576
Stack trace:
#0 lib.php(367): SimpleDOM->insertXML('<prebuilt.credi...')
#1 save_document....
i removed some elements from a xml file with simpledom.
the code:
$this->xmlDocument->removeNodes("//entity[name='mac']");
here is the initial file:
<entity id="1000070">
<name>apple</name>
<type>category</type>
<entities>
<entity id="7002870">
<name>mac</name>
<type>category</type>
...
Here's what i'm trying to do:
1) Take a basic XML page (data.xml)
2) Load it with simpleDOM
3) Use simpleDOM sortedXPath to sort all XML items by their pubDate
4) Display sorted output
Here is the code I currently have. My code below outputs exactly what I need when run it on my localhost (XAMPP w/PHP 5.3) but on my remote server (which...