I briefly touched on this subject a while back, but it has recently come up again. Should we treat XSLT and XML Schema (and others, maybe XQuery) as just resource files, or are there cases where it would be better to treat them as first class .Net languages? Since both XSLT and XML Schema came to life via the W3C, they have been traditionally treated like resource files (late bound script files in the best cases), that need to get deployed with your app, and are interpreted at runtime (and hopefully cached). I guess this is because these are declarative and not imperative languages. But, SQL is a declarative language, and we do have forms of the language that get compiled before runtime (stored procedures). At the moment, we can not do this with either XSLT or XML Schema, but the question remains, is this something that might be useful (boy I can see the flame wars over compiled XSLT versus dynamic XSLT already, just like the stored proc versus dynamic SQL).
With .Net 2.0, XSLT can now be compiled to MSIL using XslCompiledTransform, but it XSLT is still treated as a resource file. With XML Schema, they can be cached, but as far as I know, you can’t compile them down to MSIL. The most significant feature (in relation to this idea) is that MSBuild supports multiple programming languages in the same project. So, in theory, if you can compile C# and VB.Net in the same project, why not XSLT or XML Schema? There are certain things that I can write faster using a declarative language (and seem more natural), then with an imperative one, and why should picking one over the other force me to either compile it or, treated as a resource file.
The next logical step in this inspiration is why stop at XML based languages? Meaning, what about XQuery? Would XQuery be a better language to include within Visual Studio (over XSLT)? I know that a lot of developers have a real hard time with the syntax of XSLT, since it is based on XML. Combine that with the fact that more data developers know SQL over XSLT, and does that make XQuery a better language for the VS.Net developer? Especially considering XQuery is all about querying hierarchical data, which is probably more important to a VS.Net develop, then a language to fully transform hierarchical data.
I’d like to get some feedback on this. I’m I going over the edge here, or is this something that will make things easier for the average developer?