且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 XSLT 中呈现带有属性的自关闭 HTML 标记?

更新时间:2023-12-05 22:44:46

有一个肮脏的方法:欺骗"处理器并产生一个字符串

There is a dirty way for this: "fooling" the processor and producing a string

<xsl:for-each select="c:Image">
  <xsl:text disable-output-escaping="yes">&lt;img src="</xsl:text>
  <xsl:value-of select="@src" />
  <xsl:text disable-output-escaping="yes">" /&gt;</xsl:text>
</xsl:for-each>  

好吧,我同意这是一个可怕的技巧,但它适用于所有 proc.

OK, I agree that it's an awful trick, but it works with all proc.