I’m trying to use CreateXSLTransformer to run a transformation on an XML file and then import it as records into a database. I keep getting the error message “XSL transform operation as failed” (on the marked line below). I’ve run the transform using XMLSpy and at a command line using the Saxon parser - there are no errors and the transform works correctly. So it has to be something on the Lotus side, but I don’t know what. Any ideas?
Sub Initialize
On Error Goto errhand
Dim s As New notessession
Dim InputStream As NotesStream
Dim StyleStream As NotesStream
Dim transformer As NotesXSLTransformer
Dim Importer As NotesDXLImporter
Dim db As Notesdatabase
Dim doc As notesdocument
Dim xmlFile As String
Dim xslFile As String
Dim filePath As String
Set db = s.currentdatabase
xmlFile = "ddiscpub_sfa_20051121_013400_4.xml"
xslFile = "tranformCustData.xsl"
filePath = "c:\dxl\"
Set InputStream = s.CreateStream
If Not InputStream.Open(filepath & xmlFile) Then
Msgbox "Cannot open " & filePath & xmlFile
Exit Sub
End If
Set StyleStream = s.CreateStream
If Not StyleStream.Open(filepath & xslFile) Then
Msgbox "cannot open " & filePath & xslFile
Exit Sub
End If
Set transformer = s.CreateXSLTransformer(InputStream, StyleStream)
Set Importer = s.CreateDXLImporter(transformer, db)
transformer.process 'errors on this line
InputStream.Close
StyleStream.Close
Exit Sub
errhand:
Msgbox "error at line " & Erl & ": " & Error
Exit Sub
End Sub