這只是正常:您可以在document()函數中使用XSL變量嗎?
<xsl:variable
name="issue_info_file"
select="document('/issues/2010/12/08/info.xml')
/page-components/issue-metadata-component/title"/>
但這並不:
<xsl:variable
name="issue_info_file"
select="string(concat($full_issue_path,'/info.xml'))"/>
<xsl:variable
name="issue_title"
select="document($issue_info_file)
/page-components/issue-metadata-component/title"/>
有誰如果這是即使在XSLT允許嗎?如果沒有,有沒有人推薦使用動態變量打開文件的解決方案?
沒有理由不應該工作,除非你的`$ full_issue_path`變量當然包含錯誤的值。你可以在輸出中打印`$ issue_info_file`的值來看看它的評估結果是什麼? – biziclop 2011-01-24 16:55:36
可能使用{} thingy – Treemonkey 2011-01-24 16:56:19