XSLT转义> [英] XSLT escaping >

查看:175
本文介绍了XSLT转义>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题像很多人逃避>标志。
数据xml文件看起来像

 < XML> 
< check><![CDATA [value> 60]] GT;< /检查>
< / Xml>

与xslt我想创建一个c#函数。支票是在if语句中使用的项目。

  public void product(int value)
{
if(< xsl:value-of disable-output-escaping =yesselect =actie/>)

这应该是:if(value> 60)返回if(value& gt; 60)

}

< xsl:value-of cdata-section-elements =check/> 不能使用,因为我无法在模板中使用此数据。 >

禁用输出转义只返回& gt;





感谢你在
advance

解决方案

感谢vor的帮助,但它不是解决方案,有一个朋友的一些帮助,告诉我,我在调用xslt文件错了
我所以是: p>

  XPathDocument myXPathDoc = new XPathDocument(../../ file.xml); 
XslTransform myXslTrans = new XslTransform();
myXslTrans.Load(../../ file.xslt);
XmlTextWriter myWriter = new XmlTextWriter(../../ file.txt,null);
myXslTrans.Transform(myXPathDoc,null,myWriter);

我将其更改为:



<$ p $ xslCompiledTransform()
myXslTrans.Load(../../ file.xslt);
myXslTrans.Transform(../../ file.xml,../../file.cs);

现在工作


i have a problem like a lot of people with escaping the > sign. the data xml file looks like

<XML>
<check><![CDATA[value > 60]]></check>
</Xml>

with xslt i would like to create a c# function. the checks are items that gone be used in a if statement.

public void product(int value)
{
if( <xsl:value-of disable-output-escaping="yes" select="actie" />)

this should be: if( value > 60 ) but returns if( value &gt; 60 ) 

}

<xsl:value-of cdata-section-elements="check"/> can't be used becouse i can't use this data in a template.

disable-output-escaping just returns &gt;

hope one of u have a working solution.

thanking you in advance

解决方案

Thanks vor the help but it wasn't the solution, had some help from a friend who told me i was doing it wrong on calling the xslt file What i dit was:

XPathDocument myXPathDoc = new XPathDocument("../../file.xml");
XslTransform myXslTrans = new XslTransform();
myXslTrans.Load("../../file.xslt");
XmlTextWriter myWriter = new XmlTextWriter("../../file.txt", null);
myXslTrans.Transform(myXPathDoc, null, myWriter);

i changed it to:

XslCompiledTransform myXslTrans = new XslCompiledTransform();
myXslTrans.Load("../../file.xslt");
myXslTrans.Transform("../../file.xml", "../../file.cs");

now it worked

这篇关于XSLT转义&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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