1
生病非常感激,如果任何人能幫助我找到一種方法來讀取文本作爲XPath表達式我如何讀取文本XPath表達式
例如這是我的xml文檔
<abc>
<XYZ>
<include>/citizen[./marital_status[text() ='married']]</include>
</XYZ>
</abc>
,我在這裏寫一個樣式表
<xsl:template match="abc">
<xsl:call-template name="evaluate">
<xsl:with-param name="include">
<xsl:apply-templates select="$include"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
的問題是,這裏<include>
元素的文本是什麼我想在<xsl:apply-templates select="$include"/>
XPath表達式。這會給我結婚的公民,但在這裏我只是得到了字符串"/citizen[./marital_status[text() ='married']]"
。有沒有可能的做法?
在此先感謝
元素我不相信這是可能的xslt 1.0而不使用http://www.exslt.org/或其他擴展功能。 –
http://stackoverflow.com/questions/1551526/is-it-possible-to-use-a-dynamic-xpath-expression-in-a-xslt-style-sheet –