1
// ****************************************************************
2
// Copyright 2007, Charlie Poole
3
// This is free software licensed under the NUnit license. You may
4
// obtain a copy of the license at http://nunit.org
5
// ****************************************************************
11
using System.Xml.XPath;
16
/// Summary description for XmlResultTransform.
18
public class XmlResultTransform
20
#if CLR_2_0 || CLR_4_0
21
private XslCompiledTransform xslTransform = new XslCompiledTransform();
23
private XslTransform xslTransform = new XslTransform();
26
public XmlResultTransform() { }
28
public XmlResultTransform( string stylesheet )
33
public XmlResultTransform( XmlReader reader )
38
public void Load( string stylesheet )
40
xslTransform.Load( stylesheet );
43
public void Load( XmlReader reader )
45
// NOTE: Not compatable with .NET 1.0.
46
// xslTransform.Load(reader, null, null);
48
xslTransform.Load(reader);
51
public void Transform( string inputFile, string outputFile )
53
Transform( new StreamReader( inputFile ), new StreamWriter( outputFile ) );
56
public void Transform( TextReader reader, TextWriter writer )
58
Transform( new XPathDocument( reader ), writer );
61
public void Transform( IXPathNavigable xpnav, TextWriter writer )
63
// NOTE: Not compatable with .NET 1.0.
64
// xslTransform.Transform(xpnav, null, writer, null);
66
xslTransform.Transform(xpnav, null, writer);
1
// ****************************************************************
2
// Copyright 2007, Charlie Poole
3
// This is free software licensed under the NUnit license. You may
4
// obtain a copy of the license at http://nunit.org
5
// ****************************************************************
11
using System.Xml.XPath;
16
/// Summary description for XmlResultTransform.
18
public class XmlResultTransform
20
#if CLR_2_0 || CLR_4_0
21
private XslCompiledTransform xslTransform = new XslCompiledTransform();
23
private XslTransform xslTransform = new XslTransform();
26
public XmlResultTransform() { }
28
public XmlResultTransform( string stylesheet )
33
public XmlResultTransform( XmlReader reader )
38
public void Load( string stylesheet )
40
xslTransform.Load( stylesheet );
43
public void Load( XmlReader reader )
45
// NOTE: Not compatable with .NET 1.0.
46
// xslTransform.Load(reader, null, null);
48
xslTransform.Load(reader);
51
public void Transform( string inputFile, string outputFile )
53
Transform( new StreamReader( inputFile ), new StreamWriter( outputFile ) );
56
public void Transform( TextReader reader, TextWriter writer )
58
Transform( new XPathDocument( reader ), writer );
61
public void Transform( IXPathNavigable xpnav, TextWriter writer )
63
// NOTE: Not compatable with .NET 1.0.
64
// xslTransform.Transform(xpnav, null, writer, null);
66
xslTransform.Transform(xpnav, null, writer);