使用相同的 simplexmlobject 文件获得不同的输出...?
抱歉,我忘记检查 $MeshHeading->QualifierName...现在我做了...但我仍然收到错误...?
如果得到这个 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 ($Citation->MeshHeadingList)
{
foreach ($Citation->MeshHeadingList->MeshHeading as $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 is missing in article " . $i . "<br />";
$l++;
}
我得到这个...?
[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
[]
此致 泰斯
Sorry, i forgot to put a check for the $MeshHeading->QualifierName... now i did... but i still get the error...?
If got this 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 i put in this code:
if ($Citation->MeshHeadingList)
{
foreach ($Citation->MeshHeadingList->MeshHeading as $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 is missing in article " . $i . "<br />";
$l++;
}
I get 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这就是问题所在:
I think this is the problem :