I've been able to pull and assign a XSLT parameter in ASP, but I'm now converting my site over to ASP.NET. I'm using XML, XSLT, ASP.NET, and
VB.NET for this new site using the xslTransform method, and I want to pull an XSLT parameter into the ASP.NET page, and then assign a new value to that XSLT paramater using a form that's created from the XSLT stylesheet. This is what I have so far:
XSLT parameter
Code:
<xsl:param name="fname_value" select="''" />
ASP.NET code
Code:
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" AspCompat="true" Debug="true" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Web" %>
<%@ import Namespace="System.Web.UI" %>
<%@ import Namespace="System.Web.UI.WebControls" %>
<%@ import Namespace="System.Web.UI.HtmlControls" %>
<%@ import Namespace="System.Xml" %>
<%@ import Namespace="System.Xml.Xsl" %>
<%@ import Namespace="System.Xml.XPath" %>
<%@ import Namespace="System.IO" %>
<%@ Import Namespace="System.Text" %>
<script language="vb" runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim xmlURL As String = "form.xml"
Dim xslURL As String = "form.xsl"
'Assign dynamic url for this page
xslTransform.DocumentSource = xmlURL
xslTransform.TransformSource = xslURL
End Sub
</script>
<html>
<body>
<asp:Xml id="xslTransform" runat="server"></asp:Xml>
</body>
</html>
I haven't found much on how to do this in ASP.NET, but I did find a great article from a book titled "XSLT and ASP.NET" at
http://www.topxml.com/dotnet/article...ansforming_XML under the ".NET Classes Involved in Transforming XML" section. The book/article is written in C#, and I use
VB.NET. But I'm using a C# to
VB.NET converter at
http://www.developerfusion.co.uk/uti...sharptovb.aspx to help out.
As far as I can see, this article doesn't have any examples involving pulling and assigning a value for an XSLT parameter using the method that I'm using, so I'm not sure where to go with this. So I'm looking for some direction on this subject. I'd appreciate any help. Thanks.
KWilliams