将 html 标签存储在 xsl 变量中 [英] Storing html tags within an xsl variable

查看:26
本文介绍了将 html 标签存储在 xsl 变量中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Sorry if this is a dumb question, but it is possible to store, and retrieve, a HTML snippet within an xsl 1.0 variable? EG:

<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"/>

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

It just when I try, it seems to strip the HTML tags out. Thanks.

推荐答案

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

You need to use <xsl:copy-of select="$something"/> instead of xsl:value-of.

这篇关于将 html 标签存储在 xsl 变量中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆