LOTUSSCRIPT/COM/OLE CLASSES


Example: SchemaLocation property
This agent generates DXL from the current database using a specified schema for validation.

Sub Initialize
 Dim session As New NotesSession
 Dim db As NotesDatabase
 Set db = session.CurrentDatabase
 
 REM Open xml file named after current database
 Dim stream As NotesStream
 Set stream = session.CreateStream
 filename$ = "c:\dxl\" & Left(db.FileName, Len(db.FileName) - 3) & "dxl"
 If Not stream.Open(filename$) Then
   Messagebox "Cannot open " & filename$,, "Error"
   Exit Sub
 End If
 Call stream.Truncate
 
 REM Export current database as DXL
 Dim exporter As NotesDXLExporter
 Set exporter = session.CreateDXLExporter
 exporter.ValidationStyle = VALIDATIONSTYLE_SCHEMA
 exporter.SchemaLocation = _
   "http://www.lotus.com/dxl xmlschemas/domino_7_0.xsd"
 Call exporter.SetInput(db)
 Call exporter.SetOutput(stream)
 Call exporter.Process
End Sub

See Also