[ad_1]
Hi everyone I’m trying to check for the ancestor of specific node but with no success, hope some of you can help me to achieve this
This is how the XML looks like
I have the code to read the data from the node in red rectangle but I want to check if the ancestor node is the one inside the green rectangle
foreach ($xml->xpath('//c:Traslado') as $cfdi89) {
if ($cfdi89['Base']) {
$base = mysql_real_escape_string($cfdi89['Base']);
$impuesto = mysql_real_escape_string($cfdi89['Impuesto']);
$tipoFactor = mysql_real_escape_string($cfdi89['TipoFactor']);
$tasaOCuota = mysql_real_escape_string($cfdi89['TasaOCuota']);
$importe = mysql_real_escape_string($cfdi89['Importe']);
...
}
}
Hope you can help me, thank you
[ad_2]