I posted a note about this a while back and got a response but have lost it.

I've got a little more insight now.

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"];
echo $cat."  ".$vuln_cat."<BR>";
        
                        $vulns =
$xml->evaluate("//SCAN/IP[@value=".$ip_ip."]/VULNS[1]/CAT[@value=".$vuln_cat
."]/VULN");

                        foreach ($vulns as $vuln)
                        {
echo $vuln."<BR>";
                                $vuln_atts = $xml->get_attributes($vuln);
                                $vuln_sev = $vuln_atts["severity"];
                                
----------------------------------------------------------------------------
-------------------------------------

When the loop gets to the last $cat, it picks up the $vulns from all of the
previous $cats as well as the last one.
This can be seen in the following diagnostic print out. There are no * or
other special characters involved. Is this a bug or am I missing something. 

It only seems to happen on the last group.

/SCAN[1]/IP[1]/VULNS[1]/CAT[1] dns
/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[1]/VULN[7]
/SCAN[1]/IP[1]/VULNS[1]/CAT[2] identd
/SCAN[1]/IP[1]/VULNS[1]/CAT[2]/VULN[1]
/SCAN[1]/IP[1]/VULNS[1]/CAT[3] tcp-ip
/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[1]/VULN[7]
/SCAN[1]/IP[1]/VULNS[1]/CAT[2]/VULN[1]
/SCAN[1]/IP[1]/VULNS[1]/CAT[3]/VULN[1]
/SCAN[1]/IP[1]/VULNS[1]/CAT[3]/VULN[2]
/SCAN[1]/IP[1]/VULNS[1]/CAT[3]/VULN[3]
/SCAN[1]/IP[1]/VULNS[1]/CAT[3]/VULN[4]

Steve Dowell
                
--
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]
https://lists.sourceforge.net/lists/listinfo/phpxmldb-phpxml-arc

Reply via email to