Subject: RE: Whole DB code search
??? XML document structure is defined in a DTD or Schema, and the only requirements are:
-
The <?xml version=....?> header must appear as the first line;
-
Any tagged element be closed, either as a container (e.g. data goes here) or standalone (e.g. ); and
-
Nesting order be maintained (e.g. data is allowed, data is not allowed).
Apart from that, it’s the DTD/Schema that determines which elements are required and which are optional. When you import documents into Notes, you only need to use the fields (items) you need to use – just like creating a document and setting field values in the back-end in LotusScript or Java. If you want to throw fields onto a document that don’t appear on the form, then go for it. No restrictions, as long as you use a well-formed tag.
As for the export – yes, it takes an agent. To export the entire design of a database, the agent looks like this:
Dim s As New NotesSession
Dim thisDb As NotesDatabase
Set thisDb = s.CurrentDatabase
Dim nc As NotesNoteCollection
Set nc = thisDb.CreateNoteCollection(False)
Call nc.SelectAllDesignElements(True)
Call nc.BuildCollection
Dim exporter As NotesDXLExporter
Set exporter = s.CreateDXLExporter
Dim stream As NotesStream
Set exporter = s.CreateStream
Call stream.Open(“C:\temp\filename.dxl”)
Call exporter.SetInput(nc)
Call exporter.SetOutput(stream)
Call exporter.Process
The import is similarly simple. Create the stream and opn the file, create a dxl importer and set the stream as input and the database as output. You just need to remember to set the design import options to DXLIMPORTOPTION_REPLACE_ELSE_CREATE.