With VS2005 I see that the XslTransform class has been deprecated and
XslCompiledTransform has replaced it. I am having issues with trying to get
the new class to work how it did with the old. I would appreciate if
someone could tell me how to replace the following code with the new class.
Mainly, I just don't know how to pass my evidence object into the new class
but feel that I am consfused by the whole structure at the moment.
Thanks,
Matt
Dim xslArgs As New XsltArgumentList
Dim xslXForm As New XslTransform
Dim svResolver As New CustomResolver
Dim xslt As String
Dim ms As New MemoryStream
Dim sr As New StreamReader(ms)
Dim clsExt As New XslExtensions
Dim evidence As System.Security.Policy.Evidence =
XmlSecureResolver.CreateEvidenceForUrl("D:\Sorvive Apps\XSL\")
'-- Retreive XSL
xslt = RetrieveXSL(strSenderID, strReceiverID, strPipType, strPipName,
strTranID)
'-- Pass Sorvive Extension Class to XSL
Try
Me.xslArgs.AddExtensionObject("urn:sorvive-extension", clsExt)
Catch ex As ArgumentException
Logging.WriteLine("*** Error on XSL Extension ***")
Logging.WriteLine(ex.Message)
Logging.WriteLine("------------------------------")
End Try
'-- Load XSL into Processor
Try
xslXForm.Load(New XmlTextReader(New StringReader(xslt)), svResolver,
evidence)
Catch ex As XsltException
Logging.WriteLine("*** Error During XSL Load ***")
Logging.WriteLine(ex.Message)
Logging.WriteLine("------------------------------")
Catch ex As Exception
Logging.WriteLine("*** Error During XSL Load ***")
Logging.WriteLine(ex.Message)
Logging.WriteLine("------------------------------")
End Try
'-- Transform XML Document
Try
xslXForm.Transform(xml, Me.xslArgs, ms, svResolver)
Catch ex As Exception
Logging.WriteLine("*** Error During Translation ***")
Logging.WriteLine(ex.Message)
Logging.WriteLine("------------------------------")
End Try