XSL Transformations

Java and .NET both provide comparable support for XSLT. An understanding of XSL is necessary to use these features; the W3C Recommendation "Extensible Stylesheet Language (XSL) Version 1.0" contains a full definition of XSL.

The .NET System.Xml.Xsl.XslTransform class encapsulates an XSLT processor providing functionality comparable to that of the javax.xml.Transformer class. The use of both classes follows roughly the same pattern. For the .NET XslTransform class, this can be summarized as follows:

  • Create an XslTransform instance.

  • Load a style sheet into the XslTransform using the Load method.

  • Execute the transformation against an XML source using the Transform method.

Creating a Transformer

Java provides the static javax.xml.transform.TransformerFactory.newTransformer ...

Get C# for Java Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.