【发布时间】:2012-07-10 09:55:27
【问题描述】:
所以我有这个 XML
<entry>
<id>ABC123</id>
<title type="text">title </title>
<author xmlns="http://www.w3.org/2005/Atom">
<name>test.com</name>
</author>
<link rel="self" href="http://www.test.com/asdasd.html"/>
<updated>2012-07-04T06:12:15.337</updated>
<content type="xml">
<listing systemId="thesystemid" url="www.myurl.com">
<description>
This is a description
</description>
</listing>
</content>
</entry>
我正在使用 XMLReader 和这段代码,我正在使用这个来提取数据:
$url = $product->content->listing['url'];
$id = $product->id;
$name = $product->title;
$desc = $product->content->listing->description;
除了 $desc 之外,一切都被完美地拉入了
$product 已被设置为“入口”
我就是不明白为什么,有什么想法吗?
错误是
Notice: Trying to get property of non-object in......
干杯
【问题讨论】:
-
在帖子中添加了错误:)
-
我认为某些元素缺少描述..你能检查一下吗?