我已经定义的变量称为标记,其选择的节点集的名字有几个值中的一个元素:如何缩短此xpath表达式?
<xsl:variable name="tags" select="//xs:element[@name='Subscription' or @name='Account' or @name='Product' or @name='ProductRatePlan' or @name='ProductRatePlanCharge' or @name='Usage']"/>
我想定义一个变量,例如:
<xsl:variable name="tagNames" select="'Subscription','Account','Product','ProductRatePlan','ProductRatePlanCharge','Usage'/>
怎么可能我重写第一个表达式来选择所有名称在集合$ tagNames中的节点?从本质上说,我要找的是很是类似一个SQL集合成员的操作:
SELECT * FROM tags WHERE name in ('Subscription', 'Account', 'Product'....)
你使用哪种版本的XSLT的? – nwellnhof 2013-04-08 20:05:10
我相信它是2.0。 – 2013-04-09 20:14:38