O'Reilly logo

Special Edition Using XSLT by Michael Floyd

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Transformations with .NET

The .NET framework provides a very useful XslTransform class that can be used for transformations. The Class allows the output to behave in many ways. It can be output to the console, saved to a new file, or added to a new text stream.

The XslTransform class includes the Load() and Transform() methods that let you read both a style sheet and a source document, and then transform the source document by applying the style sheet to it. For example, you can load a style sheet directly by writing

xslDoc.Load(“myStlesheet.xsl”) 

After your style sheet has been loaded in the xslDoc object, you can apply the transformation by writing

xslDoc.Transform(XMLDoc, Nothing, objXMLString) 

The best way to see how this works in practice ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required