Dynamic XSLT at runtime help

  • Thread starter Thread starter SAL
  • Start date Start date
S

SAL

Hi,

Does anyone have any sample code they did in which they created a dynamic
XSLT at runtime?

I've seen many examples on the web in which an Embedded xsl:stylesheet is
transformed in the code behind, which is fine if your predefined columns
never change. However, I am wanting to have reusable code in which my
columns will be defined dynamically from a dataset and elimate the need to
manage an xslt file. I will also be building a multi-worksheet Excel Workbook
dynamically and then transform my dataset so that data can be exported to it.

If anyone has sample code on how to do this that would be greatly appreciated.

Thanks,
 
SAL said:
Hi,

Does anyone have any sample code they did in which they created a dynamic
XSLT at runtime?

I've seen many examples on the web in which an Embedded xsl:stylesheet is
transformed in the code behind, which is fine if your predefined columns
never change. However, I am wanting to have reusable code in which my
columns will be defined dynamically from a dataset and elimate the need to
manage an xslt file. I will also be building a multi-worksheet Excel
Workbook
dynamically and then transform my dataset so that data can be exported to
it.

If anyone has sample code on how to do this that would be greatly
appreciated.

Thanks,
Don't see a real problem here, you can start with an XSLT "template" and
modify it as you would any other XML file, using the DOM or LINQ to XML etc.
If you don't have a template then you could just build the whole XSLT in
memory but that could be a lot of code.
 
Back
Top