sorry, forgot put check $meshheading->qualifiername... did... still error...?
if got simplexmlobject:
[meshheading] => array ( [0] => simplexmlelement object ( [descriptorname] => acoustic stimulationment object [qualifiername] => methods ) [1] => simplexmlelement object ( [descriptorname] => adolescent ) [2] => simplexmlelement object ( [descriptorname] => age factors ) [3] => simplexmlelement object ( [descriptorname] => child ) [4] => simplexmlelement object ( [descriptorname] => electromyography [qualifiername] => methods ) [5] => simplexmlelement object ( [descriptorname] => female ) [6] => simplexmlelement object ( [descriptorname] => galvanic skin response [qualifiername] => physiology ) [7] => simplexmlelement object ( [descriptorname] => humans ) [8] => simplexmlelement object ( [descriptorname] => male ) [9] => simplexmlelement object ( [descriptorname] => muscle, skeletal [qualifiername] => physiology ) [10] => simplexmlelement object ( [descriptorname] => probability ) [11] => simplexmlelement object ( [descriptorname] => reaction time [qualifiername] => physiology ) [12] => simplexmlelement object ( [descriptorname] => sex factors ) [13] => simplexmlelement object ( [descriptorname] => startle reaction [qualifiername] => physiology )
if put in code:
if ($citation->meshheadinglist) { foreach ($citation->meshheadinglist->meshheading $meshheading) { echo "<pre>"; echo "[" .$meshheading->descriptorname . "] "; echo "[" .$meshheading->descriptorname->attributes() . "]"; echo "<br /"; if ($meshheading->qualifiername); { echo "[" .$meshheading->qualifiername . "] "; echo "[" .$meshheading->qualifiername->attributes() . "]"; } echo "</pre>"; } } else { echo "mesheading missing in article " . $i . "<br />"; $l++; }
i this...?
[acoustic stimulation] [n] [adolescent] [n] warning: main() [function.main]: node no longer exists in /home/thijs/project/phptest/pubmed_fetch.php on line 119 [] [age factors] [n] warning: main() [function.main]: node no longer exists in /home/thijs/project/phptest/pubmed_fetch.php on line 119 [] [child] [n] warning: main() [function.main]: node no longer exists in /home/thijs/project/phptest/pubmed_fetch.php on line 119 [] [electromyography] [n] [female] [n] warning: main() [function.main]: node no longer exists in /home/thijs/project/phptest/pubmed_fetch.php on line 119 []
best regards thijs
i think problem :
if ($meshheading->qualifiername); ________________________________^ <-- remove semicolon if ($meshheading->qualifiername) { ... } /* better */ if (isset($meshheading->qualifiername)) { ... }
Comments
Post a Comment