XSLT渲染和放大器; GT;和与放大器; LT;对于><怎么办我解决这个得到什么? [英] XSLT renders > and < for >< how to do I get around this?

查看:123
本文介绍了XSLT渲染和放大器; GT;和与放大器; LT;对于><怎么办我解决这个得到什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些code包裹在CDATA标记在XSLT文件:

I have some code wrapped in a CDATA tag in an xslt file:

 <span>
   <xsl:text><![CDATA[<asp:LinkButton ID ="]]></xsl:text><xsl:value-of select="ID"/>
   <xsl:text><![CDATA[" onclick="LinkClicked">]]></xsl:text >

   <xsl:value-of select="."/>
   <xsl:text><![CDATA[</asp:LinkButton>]]></xsl:text>
 </span> 

当它呈现在它的页面&放大器; GT; &放大器; LT; ,我该怎么办解决这个问题?

When it renders in the page it is &gt; and &lt;, how do I get around this?

现在我知道周围的工作,因为我可以做字符串中替换此之后被渲染,但是这似乎并不像最好的方法。

Now I know a work around as I can do a replace within the string after this is rendered, but this doesn't seem like the best approach.

推荐答案

您需要更改XSLT code:

You need to change your XSLT code:

<span>
  <asp:LinkButton ID="{ID}" onclick="LinkClicked">
    <xsl:value-of select="."/>
  </asp:LinkButton>
</span> 

这一切CDATA杂耍不仅是坏大家的视线,也是错误的做法无论你如何看待它。

All this CDATA juggling is not only bad for everybody's eyes, but also the wrong approach no matter how you look at it.

在声明的XSLT ASP 命名空间和使用的实际的ASP.NET code,而不是文本的看起来 code。

Declare the asp namespace in XSLT and use actual ASP.NET code, not text that looks like code.

这篇关于XSLT渲染和放大器; GT;和与放大器; LT;对于&GT;&LT;怎么办我解决这个得到什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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