SimpleXML xpath 定向 (Google Checkout)
将 google checkout 响应集成到 simplexml 中,以便我可以提取数据并保存它,但由于令人烦恼的原因似乎无法提取数据。
尝试获取项目名称 Bridges: Liquids and Gases、Bridges: Habitats of Australia
SimpleXML = http://pastie.org/ private/qtmbsgtinv7x5g6ikrzq
$xml = new \SimpleXMLElement($raw_xml);
$book = $xml->xpath('//item-name');
while(list( , $node) = each($book)) {
echo 'Book: ',$node,"\n";
}
我尝试过不同的方法
$book = $xml->xpath('/authorization-amount-notification/order-summary/shopping-cart/items/item/item-name');
Integrating the google checkout response into simplexml so i can pull the data and save it, but for the annoying reasons can't seem to pull the data out.
Trying to get the item names Bridges: Liquids and Gases, Bridges: Habitats of Australia
SimpleXML = http://pastie.org/private/qtmbsgtinv7x5g6ikrzq
$xml = new \SimpleXMLElement($raw_xml);
$book = $xml->xpath('//item-name');
while(list( , $node) = each($book)) {
echo 'Book: ',$node,"\n";
}
I've tried different approaches
$book = $xml->xpath('/authorization-amount-notification/order-summary/shopping-cart/items/item/item-name');
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 Google Checkout PHP 客户端库源代码以获取更多想法,特别是 XML 解析器:
http://code.google.com/apis/checkout/samplecode.html
Look at the Google Checkout PHP client library source code for more ideas, in particular at the XML parser:
http://code.google.com/apis/checkout/samplecode.html