SimpleXML XPath
No |
Name |
Role |
xpath("//employee[@no>1 and role!='Intern']") as $employee) {
// find attribute no
$no = $employee->xpath("@no")[0];
// find sub elements name and role
$name = $employee->xpath("name/text()")[0];
$role = $employee->xpath("role/text()")[0];
// print
echo "\r\n";
echo "$no | \r\n";
echo "$name | \r\n";
echo "$role | \r\n";
echo "
\r\n";
}
?>