用简单的馅饼从原子进料中拉出
16lz
2021-01-22
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.
您可以从
<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');
更多相关文章
- MYSQL5.5和5.6参数的差异
- hibernate(*.hbm.xml)中新添加的字段被标记为红色(找不到)的解决方法
- 存储过程,参数数量不正确bug?
- MySQL数据库 prompt参数详解
- MyBatis排序时使用order by 动态参数时需要注意,用$而不是# 用$传
- 如果发现自己的mysql没有充分利用CPU该关注那些参数?
- 解析innodb status各项参数
- 可以访问Stackoverflow的自动建议标记系统吗?
- 如何将对象作为参数传播给函数?