I’m using DXLExporter and XSLTransformer to make a .fo file with a xsl stylesheet and then transform it to a pdf file.
That all works good, but only once per session. I must restart my client to run the script again. If I don’t then I get this error:
"<?xml version='1.0'?>
<fatalerror line='2' column='57'>
An exception occurred!
Type:XMLPlatformException, Message:Could not open file: xmlschemas\domino_6_5_1.dtd
</fatalerror>
<error>
XSL transform operation failed
</error>
This is the code (part of it):
Sub ExportAndApplyXSL (doc As NotesDocument, XSLName As String, OutputFilename As String)
Dim session As New NotesSession
Dim exporter As NotesDXLExporter
Dim OutputStream As NotesStream
Dim Transformer As NotesXSLTransformer
Dim Stylesheet As String
' Create a stream object to access the output file
Set OutputStream = session.CreateStream
isopen = OutputStream.Open (OutputFilename, "UTF-8")
If Not isopen Then
Messagebox "Gat ekki opnað XSL-straum"
Exit Sub
End If
OutputStream.Truncate
Set exporter = session.CreateDXLExporter (doc, OutputStream)
' Set up the processing pipeline
If XSLName = "" Then
' No transformations specified -- export the DXL directly to the output file
exporter.SetOutput OutputStream
Else
' Pipe the DXL from the exporter into an XSL transformer
Stylesheet = GetStylesheet (XSLName)
Set Transformer = session.CreateXSLTransformer (exporter, Stylesheet)
Transformer.SetOutput OutputStream
End If
' Fire up the export -> {transform} -> {transform} pipeline
On Error Goto errh
exporter.process
done:
OutputStream.Close
Exit Sub
errh: ’ On error, dump the xml logs
Msgbox exporter.log
If XSLName <> "" Then
Msgbox Transformer.log
End If
Resume done
End Sub