我正嘗試使用xpath中的for-each變量。但它給了我一個表達式必須評估爲節點集的錯誤。如何在變量中存儲xpath並將它與XSLT 1.0配合使用
節點名被定義爲
<xsl:variable name="NodeName" select="name(.)"/>
<xsl:variable name="SyncPath"
select="concat('/combinedxml/com.csc_PolicySyncRs/',$NodeName)"/>
,這裏是for-each循環
<xsl:for-each select="$SyncPath/*">
能否請您提供您指的是很好地格式化XSLT片段? – 2011-04-08 14:51:31
你能說明$ NodeName是如何定義的嗎? – 2011-04-08 14:59:00
這是http://stackoverflow.com/questions/4377811/using-dynamic-xpath-in-xslt或http://stackoverflow.com/questions/4682151/xslvariable-as-xpath-value-for- other-xsl-tag或http://stackoverflow.com/questions/1551526/is-it-possible-to-use-a-dynamic-xpath-expression-in-a-xslt-style-sheet或http: //www.google.com/search?q=site%3Astackoverflow.com+xslt+dynamic+xpath – 2011-04-08 15:10:07