Using VB.NET 2.0 I have a simple routine that attempts transforms an
XmlDocument with an XSLT stylesheet into HTML. Under the old 1.1
framework with XslTransform, everything worked fine. Now using
XslCompiledTransform, the Transform method hangs. My code:
Function TransformXML(ByRef FacXML As Xml.XmlDocument, ByVal XslFile As
String) As String
Dim xslt As New System.Xml.Xsl.XslCompiledTransform
Dim xmlFile As String = <code to name XML file>
Dim htmFile As String = <code to name HTML file>
Try
FacXML.Save(xmlFile)
xslt.Load(XslFile)
xslt.Transform(xmlFile, htmFile)
Return htmFile
Catch ex As Exception
Return "ERROR: There was an error creating the XSL transform." &
vbCrLf & ex.Message
End Try
End Function
Basically I pass in an XmlDocument, save it to a file, then load the
XSLT and call Transform. The method hangs the application.