PHP XPath query:
$query = $xpathvar->query('//siri:Service');
foreach($query as $service) {
echo $service->textContent;
// Here I need to also echo this Vehicle's reg
}
Targeted XML:
<Vehicle>
<CategoryA>
<Service>123123123</Service>
</CategoryA>
<CategoryB>
<SubCategoryA>
<Reg>ASDF_XC1</Reg>
</SubCategoryA>
</CategoryB>
</Vehicle>
// Imagine many more vehicles here each with a service and reg
How can I alter the PHP so that I also retrieve the Reg for each one as well? The Service and Reg have to be inside the same Vehicle when retrieved (not random pairs).