Import a C# textbox value into a XSLT to generate a .aspx page
-
Hi All, We have a C# windows application which will transform the xml and xslt we give into a .aspx page. The user has to specify the XML and the .aspx file name , we have a standard XSLT which will use the xml and create the file with the name specified by the user. The problem we face is in the .aspx page we want to write the Page attribute E.g. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" >; where we include the .aspx.cs file name , but this value comes from the C# code , how can we import the textbox value from C# code into our standard XSLT to write the page attribute in our to be generated .aspx page. Please Advice.TIA Regards, Nancy
-
Hi All, We have a C# windows application which will transform the xml and xslt we give into a .aspx page. The user has to specify the XML and the .aspx file name , we have a standard XSLT which will use the xml and create the file with the name specified by the user. The problem we face is in the .aspx page we want to write the Page attribute E.g. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" >; where we include the .aspx.cs file name , but this value comes from the C# code , how can we import the textbox value from C# code into our standard XSLT to write the page attribute in our to be generated .aspx page. Please Advice.TIA Regards, Nancy
Add a parameter at the top level of the XSLT file:
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xsl"><!-- Allow the user to specify the .cs filename -->
<xsl:param name="CSFilename"/><!-- The rest of your XSLT - use $CSFilename to access the .cs filename -->
</xsl:stylesheet>You then use the XsltArgumentList[^] class to add the parameter values when you perform the transform.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p