It was previously shown, as in the classic book of John Bentley , that a bad algorithm implemented in Assembler runs many thousands of times slower than a good algorithm implemented in Basic .
Therefore, it is simply incorrect to say that "Technology A is faster than Technology B".
As far as memory consumption is concerned, it largely depends on the size of the XML document (s). Both XmlDocument and a typical XSLT 1.0 or 2.0 processor create a representation of the complete XML document in memory, so working with XML documents with several gigabytes is problematic in both cases.
XSLT 3.0 (still in the status of a working draft) has that allows you to process an XML document in streaming mode if the XPath expressions used in the conversion adhere to certain restrictions.
I find it useful to consider a set of indicators with only one .
XSLT is a language designed specifically for processing tree structures and, as such, offers valuable features not found in other languages. Two examples are patterns and pattern matching.
Using patterns and pattern matching, a declarative transformation can be expressed . The code is much simpler, shorter, easier to understand and maintain, extensible. Writing XSLT code can usually be done in a few minutes compared to many hours of procedural coding using spaghetti in the procedural language.
Debugging a program in a functional language and even proving correctness is much simpler because the variables are immutable.
For the same reason, there are much greater opportunities for very aggressive optimization with the XSLT processor .
Finally, let me repeat the statement made otherwise by @dash's good answer:
xslt can effectively be HTML output.
On the other hand, with 2 especially, you then lose out on many of the huge features asp.net has to offer, from web forms via MVC. Given that you end up wanting to populate the asp.net server as you do, good, because otherwise you are running xslt only to get the values
Actually, there is an XSLT writing style where there is a strict and clean separation between content and processing (I call this filling in the spaces pattern).
See for example my answer to this question .
Here are some of the benefits of developing an XSLT application with this approach :
This code can fill in any rendering document (the path is passed as an external parameter) using data from any data document (again, the path is passed as an external parameter). Thus, it becomes possible to create different outputs / formats filled with various data.
Placeholders ( gen:data elements), which should be replaced by "live content", can have different formats and semantics - no restrictions for one imagination.
Editors (non-XSLT experts) can work on one or more rendering documents independently of each other and from XSLT developers.
A higher degree of reuse, flexibility and maintainability has been achieved.
To summarize : the approach of transforming XML with a procedural language based on the DOM, although possible, is more expensive in terms of development resources and leads to lower quality in terms of code complexity, maintainability and extensibility.