简体   繁体   中英

Store an xsl variable for use in xsl value-of XPath string

I realize that I lack sample XML here, however I believe my question is quite simple. With this XSL statement:

<xsl:variable name="defID" select="check/check-content-ref/@name" />

If I then wanted to use my "defID" variable in a "value-of" select="" statement how would I do this?

<xsl:value-of select="//*[@id='$defID']/metadata/description" />

The example above does not work. Clearly my syntax is incorrect, but myriad google searches do not reveal my syntactic error. Do I need to construct a whole string and then store it as a variable?

引用变量时,请勿将其括在引号中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM