xpath( "//category"); $xpresult = $doc->xpath( "//category[@name='$cat']"); if (!$xpresult) { include("badcat.php"); } $catdesc = $xpresult[0]->description; $cattitle = $xpresult[0]->title; // get all the items in this category #$xpresult = xpath_eval($xpath, "//category[@name='$cat']/items/item"); $xpresult = $doc->xpath("//category[@name='$cat']/items/item"); // dump all nodes directly in plain text if (is_array($xpresult)) { foreach ($xpresult as $node) { $child = $node; $key = $node['key']; $new = $node['new']; $xpresult2 = $doc->xpath("//category[@name='$cat']/items/item[@key='$key']"); $name = $xpresult2[0]->name; $desc= $xpresult2[0]->description; $price= $xpresult2[0]->price; $code= $xpresult2[0]->code; $name = str_replace("Marie Antoinette Number", "N°",$name); // $xpresult2 = xpath_eval($xpath, "//category[@name='$cat']/items/item[@key='$key']/description"); // $desc = $xpresult2->nodeset[0]->get_content(); // $xpresult2 = xpath_eval($xpath, "//category[@name='$cat']/items/item[@key='$key']/price"); // $price = $xpresult2->nodeset[0]->get_content(); // $xpresult2 = xpath_eval($xpath, "//category[@name='$cat']/items/item[@key='$key']/code"); // $code = $xpresult2->nodeset[0]->get_content(); if($items["$code"]['new']=='') { $items["$code"]['new'] = $new; } $items["$code"]['name'] = $name; $items["$code"]['key'] = $key; $items["$code"]['code'] = $code; $items["$code"]['cost'] = $price; $items["$code"]['desc'] = $description; } } #echo "
";
#print_r($items);
#echo "
"; ?>
$item) { $showname = eregi_replace("[^[:alnum:]]","-",$item['name']); if ($item['new']=='true') { ?> "; } } } ?> $item) { $showname = eregi_replace("[^[:alnum:]]","-",$item['name']); if ($item['new']!='true') { ?> "; } } } ?> "; $current++; } echo ""; echo "

"; ?>