How can I get the title tag from the s:variant block below using simple pie?

如何使用简单的馅饼从下面的s:variant块获取标题标签?

<s:variant>
  <id>product_variants-96590662</id>
  <title>Default Title</title>
  <s:price currency="GBP">10.00</s:price>
  <s:sku>002</s:sku>
  <s:grams>0</s:grams>
</s:variant>

I've tried the following to avail, and also 'variant' and just 's'

我尝试过以下方法,以及'变种'和's'

$caption = $item->get_item_tags('http://www.w3.org/2005/Atom', 's:variant');

The feed in question is here (from shopify), and the docs on get_item_tags is here.

有问题的Feed在这里(来自shopify),get_item_tags上的文档在这里。

1 个解决方案

#1


3

You can read the xml namespace for s from the <feed> tag.

您可以从 标记中读取s的xml命名空间。

<feed xmlns:s="http://jadedpixel.com/-/spec/shopify" xml:lang="en-US" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://www.w3.org/2005/Atom">

According to it you have to use http://jadedpixel.com/-/spec/shopify as the namespace parameter in get_item_tags(), and the second parameter is the tag name without the s:.

根据它,你必须使用http://jadedpixel.com/-/spec/shopify作为get_item_tags()中的命名空间参数,第二个参数是没有s:的标记名称。

$varinat = $item->get_item_tags('http://jadedpixel.com/-/spec/shopify', 'variant');

更多相关文章

  1. MYSQL5.5和5.6参数的差异
  2. hibernate(*.hbm.xml)中新添加的字段被标记为红色(找不到)的解决方法
  3. 存储过程,参数数量不正确bug?
  4. MySQL数据库 prompt参数详解
  5. MyBatis排序时使用order by 动态参数时需要注意,用$而不是# 用$传
  6. 如果发现自己的mysql没有充分利用CPU该关注那些参数?
  7. 解析innodb status各项参数
  8. 可以访问Stackoverflow的自动建议标记系统吗?
  9. 如何将对象作为参数传播给函数?

随机推荐

  1. 无法在Yii中更改项目的文件夹名称
  2. Mysql使用高流量数据库上的过滤器计算行
  3. PHP/MySQL性能测试
  4. 如何在PHP中接收和传递HTTP请求
  5. 评论: 网页浏览速度提高切实可行的七个方
  6. PHP:将simpleXML对象转换为二维数组
  7. PHP实现WebSocket示例
  8. php image函数,操作压缩图片时,png图片压
  9. 使用PHP查询db,通过AJAX获取结果作为变量,
  10. PHP项目转移到服务器上验证码不显示解决