Dynamic XSLT at runtime help

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,
 
J

Joe Fawcett

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top