在xsl变量中存储html标记

Str*_*_99 1 xslt xslt-1.0

很抱歉,如果这是一个愚蠢的问题,但是可以在xsl 1.0变量中存储和检索HTML代码段吗?例如:

<xsl:variable name="something"><p>Hi there</p><p>How are you today?</p></xsl:variable>

<xsl:value-of disable-output-escaping="yes" select="$something"/>
Run Code Online (Sandbox Code Playgroud)

它就在我尝试时,它似乎剥离了HTML标签.谢谢.

Mae*_*o13 9

你需要使用<xsl:copy-of select="$something"/>而不是xsl:value-of.