i read out a xml file with xsd, with this code:
foreach ($xpath->evaluate('//caaml:validAspect') as $expositons) {
echo $xpath->evaluate('string(@xlink:href)', $expositons)."<br>";
}
here i get all results but i can not assign them in which block they are. and i also tried this:
foreach ($xpath->evaluate('//caaml:DangerRating') as $dangerRating) {
echo $xpath->evaluate('string(caaml:validAspect/@xlink:href)', $dangerRating)."<br>";
}
here i only get the first value of the validAspect field.
and here is the xml structure:
and now my problem is that how can i find out in with block the data is?
Thanks!
now i tried this:
foreach ($xpath->evaluate('//caaml:DangerRating') as $i => $block) {
echo "block $i
";
foreach ($xpath->evaluate('/caaml:validTime/caaml:validAspect', $block) as $expositions) {
echo $xpath->evaluate('string(@xlink:href)', $expositons)."<br>";
}
}
but i do not get any result …