比较XSL中的动态驱动值

时间:2016-01-27 06:32:51

标签: c# asp.net xslt

我使用XSLt转换表和XML数据以显示在UI页面中,这是我的问题

<xsl:variable name="Work to do" select="DocumentElement/Working[(worktype='wash' or worktype='clean' worktype='sweep') and (attendance= 'Present' or attendance = 'permit')]"></xsl:variable>

 public string milestonebugstype()
    {
        string ms_bugtype;
        string msbugs = CommonHelper.Getmilestonebug();
        string[] milestonebugs = msbugs.Split(',');
        List<string> milestone_bugs = new List<string>();
        foreach (string milestonebugtype in milestonebugs)
        {
            milestone_bugs.Add("task_type=" + "'" + milestonebugtype + "'");
        }
        ms_bugtype = string.Join(" or ", milestone_bugs.ToArray());
        return ms_bugtype;
    }
  string milestone_bugs = milestonebugtype();
  outputXml += "<WorkType>"+milestone_bugs+"</WorkType>";

 <xsl:variable name="Works" select="documentelement/worktype"></xsl:variable>
 <xsl:variable name="Work to do" select="DocumentElement/Working[($works) and (attendance= 'Present' or attendance = 'permit')]">   </xsl:variable>

我想外化 worktype =&#39; wash&#39;或worktype =&#39; clean&#39;来自数据库的worktype =&#39; sweep&#39; 我检索了数据,但不知道如何在XSL中进行操作。这里的工作类型取自表格,我想加载&#39;清洗&#39;清洁&#39;动态地通过XML。请帮帮我

1 个答案:

答案 0 :(得分:0)

在旧的c#项目中,我使用了&lt; xsl:param name =&#34; paramname&#34;&gt;&lt; / xsl:param&gt;传递参数XslCompiledTransform.Transform。我将简单类型作为字符串

传递