> I have the following code: > > $cats = $xml->evaluate("//SCAN/IP[@value=".$ip_ip."]/VULNS[1]/CAT"); > > foreach ($cats as $cat) > > > $cat_atts = $xml->get_attributes($cat); > $vuln_cat = $cat_atts["value"]; > $vuln_port = $cat_atts["port"]; > > > $vulns = > $xml->evaluate("//SCAN/IP[@value=".$ip_ip."]/VULNS[1]/CAT[@value=".$vuln_cat > ."]/VULN"); > > foreach ($vulns as $vuln) > { ...................... > > > On the first pass thru $cat I get only the $vulns for that $cat, however on > the second $cat I get the $vulns for the first and second $cat as can be > seen below. > > <snip> > /SCAN[1]/IP[1]/VULNS[1]/CAT[1] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[1] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[2] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[3] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[4] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[5] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[6] > /SCAN[1]/IP[1]/VULNS[1]/CAT[2] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[1] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[2] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[3] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[4] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[5] > /SCAN[1]/IP[1]/VULNS[1]/CAT[1]/VULN[6] > /SCAN[1]/IP[1]/VULNS[1]/CAT[2]/VULN[1] > /SCAN[1]/IP[1]/VULNS[1]/CAT[2]/VULN[2] > /SCAN[1]/IP[1]/VULNS[1]/CAT[2]/VULN[3] > /SCAN[1]/IP[1]/VULNS[1]/CAT[2]/VULN[4] > > Is this the way its supposed to work and any suggestions on how to get > around this would be greatly appreciated. I don't think that this is how it is meant to work. It's possible you've a coding error, perhaps something like a value of $cat_atts["value"] that is '*' or something, but more likely a bug. I'd suggest downloading version 1.N.4 and switching on the debug flags in the evaluate functions to get a "stack trace". This might help isolate the problem and determine if it is a bug or a coding error. If you are still stuck perhaps sending us a portion of the xml and the complete php file might allow us to reproduce the error ourselves? The evaluate() function has several known problems, and sadly it wouldn't be all that surprising if there were some more. Version 1.N.5 is going to have a complete re-write of the evaluate() function that should give us MUCH better performance. Nigel =========================== For the most recent version of phpxml, V1.N.X, and an archive of this list visit: http://www.sourceforge.net/projects/phpxmldb -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https:[EMAIL PROTECTED]/ _______________________________________________ Phpxmldb-phpxml-arc mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/phpxmldb-phpxml-arc