我有一个字符串,其中包含一组文件名,例如;可以在一组字符串标记上创建XSLT键吗?
"foo.jpg,bar.jpg"
我将其传递给XSL样式表;
<xsl:param name="images"/>
我可以以某种方式在这些文件名上创建XSLT密钥吗?
我试过这个;
<xsl:variable name="tokens" select="str:tokenize($images, ',')"/>
<xsl:key name="mykey" match="$tokens/*" use="token"/>
但我得到一个错误;
Warning: XSLTProcessor::importStylesheet(): compilation error: file
file:///C:/root/sites/bec/ line 105 element key
in C:\root\php\lib-2013-04-23.php on line 157
Warning: XSLTProcessor::importStylesheet(): xsl:key : XPath pattern
compilation failed '//$tokens/*'
我使用PHP的libxml(版本2.7.3)XSLT 1.0礼貌。
感谢一个非常明确和详细的解答。 –