I am going to be translating an XML document into another XML document based on an eXtensible Style Language Transformation. Where can I find good tutorials about how to do this in .NET?
I have found some stuff about how to do it using open source tools. But what about the .NET framework? Just a couple of other quick questions…
-
Could somebody please give me a quick and dirty explanation of the XSLT order of operations? I am still a little confused about what happens?
-
Are there any explicit .NET tools for working with XSLTs? I know that when working with XSLTs, XSDs, and XML files you get a little XML drop down list on the main menu of Visual Studio .NET. I guess that is Ok for now, but it would be nice to know if I had other options.
-
I am not going to be actually transforming files… Well, I guess the Extensible Stylesheet will be a file, but I want to import an XML string, transform it to another XML string, and then through that out to a view in the MVC design pattern. How can I do that?
From the point of view of usage, there’s only one operation: you grab some input, and the XSLT engine transforms it into an output.
With the
XslCompiledTransformyou can apply your XSL transformations.The
XslCompiledTransformclass I mentioned above can work directly on streams, orXmlReaderandXmlWriterobjects, so you can do the whole thing in memory, without any temporary files.Here’s a basic example:
If you want to learn the XSLT language itself, you can check out this previous question: “How to get started with xslt-transformations?”.