Let's say I have this XML:
<Routes>
<Route ref="timeconditions">
<Table>
<Tablename>timeconditions</Tablename>
<Fields>
<Fieldsname>truegoto</Fieldsname>
</Fields>
</Table>
</Route>
</Routes>
PHP:
$doc = new SimpleXMLElement('routingConfig.xml', null, true);
$foo = $doc->xpath('/Routes/Route[@ref="timeconditions"]/Table/Fields[@Fieldsname="truegoto"]/ancestor::Tablename');
print_r($foo);
Returns blank array. Now I realize I'm basically digging into a child then backing up to it's parent, but in my context that is what I need to do. What am I doing wrong? I'm trying to get <Fieldsname>falsegoto</Fieldsname>
parents sibling value called <Tablename>
.
Going crosseyed staring at this....