views:

102

answers:

2

What is a nice templating engine to use in C#? I have XML or JSON as structured datasource. This data needs to be presented to users on the web in strict XHTML.

I've been using XSLT mostly, but maybe there are more or better options?

It needs to be used in C# or IronPython.

+2  A: 

StringTemplate is great. I also like the Spark View Engine, which is primarily for ASP.NET MVC, but can be used on its own (the download includes a good example).

cxfx
Spark sound interesting! Is it easy to implement standalone and with XML as source to format?
hoest
Yes, there's a good standalone demo in the download, and you could use LINQ-to-XML to prepare your source data. You might also want to look into Xpark - http://whereslou.com/2009/03/23/using-xparkexe-to-transform-xml
cxfx
nice, thanks for the tips! i've read about the spark engine before for mvc, but it's also cool in my situation! ;) i'll try it!
hoest
SparkView looks great and does the trick!
hoest
I really like Spark - I use it in MVC apps as the view engine and for email templates, it's great being able to use the same for both.
cxfx
A: 

You could try Apache Velocity Engine http://velocity.apache.org/engine/index.html

srini.venigalla
You probably mean [NVelocity][1]? [1]: http://www.castleproject.org/others/nvelocity/
hoest