I get this error: (because of char limitations on pastebin.com)
And I know that I get this error only because I want to make a triangle replacement. I know that because before I implement the triangle replacement, everything worked fine...
What I want to do is to get all price and price_base tags and swap them. But I do not know why PHP is complaining about that...
Here is the code:
function specialPriceToPrice($dom, $path ,$price, $specialPrice)
{
$doc = simplexml_import_dom($dom);
$items = $doc->xpath("//$path");
foreach ($items as $item) {
$node = dom_import_simplexml($item);
$tmp = $node->getElementsByTagName($specialPrice)->item(0)->textContent;
if($tmp != ""){
$tmp2 = $node->getElementsByTagName($price)->item(0)->textContent;
$node->getElementsByTagName($price)->item(0)->textContent = $tmp;
$node->getElementsByTagName($specialPrice)->item(0)->textContent = $tmp2;
$tmp = null;
$tmp2 = null;
}
$node = null;
$tmp = null;
$tmp2 = null;
$item = null;
}
$doc = null;
$items = null;
}
I also tried $tmp != null- but same result...
Can it be that this error comes up because of the feed?
Because sometimes I have a price_base which looks like this <price_base/> but it could also be that it looks like <price_base></price_base>. And of course, sometimes it's filled 13.13.
Here is the raw feed (I rename special_price to price_base)
http: //j-trier.de/cronjob/data/gamebillet.xml (Not allowed more then 2 links)
Could the error because in my output feed the price_base ends with / and not starts with /?
Greetings and Thank You!