Click here to Skip to main content
15,885,435 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
$Result = $objXML->xpath('AllRelease/Release/name[@rdate="'.$DATERELEASE.'"]');

if(empty($Result)){
    $AllRelease = $objXML->xpath("//AllRelease");
    $releas = $AllRelease[0]->prependChild2("Release");
    $dat = $releas->prependChild2("name");
    $dat->addAttribute("rdate",$DATERELEASE);
    $releas->prependChild("comment",$COMMENT);
    $Anime = $releas->prependChild2("Anime");
    $Anime->prependChild("popup",$POPUP);
    $Anime->prependChild("Title",$VIDEONAME);
    $Anime->prependChild("VideoUrl",$dir);
    $objXML->asXML("MainRelease.xml");
}else{
    $Anime = $objXML->xpath("//Release");
    $anime = $Anime[0]->addChild("Anime");
    $anime->addChild("popup",$POPUP);
    $anime->addChild("Title",$VIDEONAME);
    $anime->addChild("VideoUrl",$dir);
    $objXML->asXML("MainRelease.xml");	
}


i did this and $Result always giving me empty in any condition so basically he won't do the second statement the xpath not working im not really sure since its first time i working with xpath, simplexml, xml any help would be appreciate
Posted
Updated 19-May-11 10:55am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900