2 시간 전에 처음으로 하나만 보았으므로 XSL 템플릿을 잘 모릅니다.XSL 템플릿 변수가 인쇄되지 않습니다.
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:FormData="ext:FormVal"
xmlns:FormUrl="ext:UrlFinder"
>
<xsl:param name="note"/>
<xsl:param name="title"/>
<xsl:template match="/">
<html>
<head>
<title>EW Email Notification- File Note insertion Failed</title>
</head>
<body>
<p>
Failed to insert File note for form with refrence - <xsl:value-of select="FormData:get_RefFormId()" /> <br/>
<a>
<xsl:attribute name="href">
<xsl:value-of select="FormUrl:get_RootUrl()"></xsl:value-of>FormAction/ViewForm?formId=<xsl:value-of select="FormData:get_FormId()"></xsl:value-of>
</xsl:attribute>Click here </a> to open the form.
</p>
<p>
Please insert this file note manually.
</p>
<p>
<h3>
Title:
</h3>
<out> <xsl:value-of select="$title"></xsl:value-of>
</out>
</p>
<p>
<h3>
Note:
</h3>
<xsl:value-of select="$note"></xsl:value-of>
</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
그것의 대부분은 다른 어떤 사람에 의해 작성되었습니다 :
나는 다음과 같은 템플릿이 있습니다. note
및 title
매개 변수를 추가했습니다. 그러나 어떤 이유로 인쇄물에 나타나지 않습니다.
그러나 FormData:get_FormId()
이 작동합니다.
이 같은 변수를 전달하고있다 :
dictionary["note"] = note;
dictionary["title"] =title;
dictionary["ext:FormVal"] = formVal;
dictionary["ext:UrlFinder"] = urlFinder;
var objxslt = new XslCompiledTransform();
objxslt.Load(Helper.GetEmbeddedXmlResource(templateAssembly, templateName));
var xmldoc = new XmlDocument();
xmldoc.AppendChild(xmldoc.CreateElement("DocumentRoot"));
XPathNavigator xpathnav = xmldoc.CreateNavigator();
var xslarg = new XsltArgumentList();
foreach (DictionaryEntry entry in dictionary)
{
xslarg.AddExtensionObject(entry.Key.ToString(), entry.Value);
}
var emailbuilder = new StringBuilder();
var xmlwriter = new XmlTextWriter(new System.IO.StringWriter(emailbuilder));
objxslt.Transform(xpathnav, xslarg, xmlwriter, null);
var xemaildoc = new XmlDocument();
xemaildoc.LoadXml(emailbuilder.ToString());
XmlNode titlenode = xemaildoc.SelectSingleNode("//title");
string subjecttext = titlenode.InnerText;
XmlNode bodynode = xemaildoc.SelectSingleNode("//body");
string bodytext = bodynode.InnerXml;
변수 bodytext
모든 템플릿을 포함하지만 매개 변수가 인쇄 할 것으로 예상 공백이 있습니다.
note
및 title
매개 변수가 출력에 표시되지 않는 이유를 찾는 사람이면 누구든지 도움을 줄 수 있습니까?