我想在值 24 的标签"id"中读取标签"name"的值。所以我想得到"奥布维达斯基"的价值。
<Data>
<Category>
<Category>
<id>15</id>
<lft>24</lft>
<rght>0</rght>
<parent>24</parent>
<name>Koturny</name>
<ger_name>Keilabsatzschuhe</ger_name>
<eng_name/>
<slug>koturny</slug>
<eng_slug>-11</eng_slug>
<ger_slug>keilabsatzschuhe</ger_slug>
<ProductsCategory>
<id>33969</id>
<category_id>15</category_id>
<product_id>15676</product_id>
</ProductsCategory>
</Category>
<Category>
<id>24</id>
<lft>0</lft>
<rght>0</rght>
<parent>0</parent>
<name>Obuwie damskie</name>
<ger_name>Damenschuhe</ger_name>
<eng_name/>
<slug>obuwie-damskie</slug>
<eng_slug>-21</eng_slug>
<ger_slug>damenschuhe</ger_slug>
<ProductsCategory>
<id>33970</id>
<category_id>24</category_id>
<product_id>15676</product_id>
</ProductsCategory>
</Category>
</Category>
</Data>
我会向你寻求帮助,因为我已经坐了一整天
包装在xsl:value
语句中的相应 XPath 表达式为:
<xsl:value-of select="/Data/Category/Category[id='24']/name" />