Say my XML looks like this:
<record>
<row name="title">this item</row>
<row name="url">this url</row>
</record>
Now I'm doing something like this:
$xml = new DOMDocument();
$xml->load('xmlfile.xml');
echo $xml->getElementByTagName('row')->item(0)->attributes->getNamedItem('title')->nodeValue;
But this just gives me:
NOTICE: Trying to get property of non-object id
Does anybody know how to get the node value where the "name" attribute has value "title"?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…