Thanks Oleg, that's what I needed.
method with these parameter types. There are 18 definitions of the
Transform method. I had to use chr(0) in place of the NULL keyword, since
Perhaps it doesn't recognize my null? System.DBNull didn't help. Perhaps
"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:O$XRmahUEHA.2524@TK2MSFTNGP12.phx.gbl...
> Eric Phetteplace wrote:
>
> > I am moving over from using msxml2.domdocument to system.xml and
> > system.xml.xsl.
> >
> > I'd like to present this to my group today, so your help is appreciated.
> >
> > I want to transform an XML object (built on the fly) with an XSL
document
> > (URL to document) and have it return a string object for my function.
> >
> > Here's where I am:
> >
> > Function x as String
> > 'this function will return transformed xml
> > Dim oXML as New System.xml.xmldocument
> > oXML.LoadXML("<document/>")
> >
> > oXSL as New System.xml.xmldocument
> > oXSL.Load([stylesheet])
> >
> > x = ???
> > End Function
>
> No, that's MSXML model. In .NET you better use the following (C# code):
>
> XmlDocument doc = new XmlDocument();
> //Build it
> doc.LoadXml("<doc/>");
> XslTransform xslt = new XslTransform();
> //Load stylesheet (you should use here Server.MapPath in ASP.NET)
> xslt.Load("whatever.xsl");
> StringWriter sw = new StringWriter();
> //Run transformation
> xslt.Transform(doc, null, sw, null);
> sw.Close();
> return sw.ToString()
>
> Additionally consider caching compiled XslTransform object for
> repetitive transformations.
> --
> Oleg Tkachenko [XML MVP]
>
http://blog.tkachenko.com