Hi,I need to export existing Notes-databases to XML files. Each document should be exported as a seperate XML-file, attachemnts should also be saved (and the corresponding XML-file should contain a link to this file).
Is this possible? I looked at a product called odbc2xml which seems to be able to do this, but it’s not too straight-forward. I am looking for something that is really designed for Notes. I have to export about a dozen databases.
Only problem is that you need Domino 6.0 or above, and you need to have a Windows platform (since I do not think that it is available on any other platform).
It is of course installed on the server, so the client does not need to have anything special to be able to convert to XML.
The other thing to bear in mind is that it is only for data, you cannot convert design to XML with this product (that unfortunately is a problem for me).
[The other thing to bear in mind is that it is only for data, you cannot
convert design to XML with this product (that unfortunately is a problem for
me).]
You even emailed me about this, and I don’t understand what you’re missing here.
Dim sess As New NotesSession
Dim db As NotesDatabase
Dim designColl As NotesNoteCollection
Dim export As NotesDXLExporter
Dim writeStream As NotesStream
Const OUT_FILE = "c:\sampleDXL.xml"
Set writeStream=sess.CreateStream
If Not writeStream.Open(OUT_FILE) Then
Messagebox "Cannot Open Destintion",, OUT_FILE
Exit Sub
End If
Set db = sess.currentdatabase
Set designColl = db.createNoteCollection(False)
Call designColl.SelectAllDesignElements(True)
Set export = sess.CreateDXLExporter(designColl, writeStream)
export.Process
Call writeStream.Close
DXL is XML. DXL is the name, the content and structure is XML. The meaning of the XML is defined in the Domino DTD (also XML). If the format doesn’t suit you, then transform it to whatever you want via XSL Stylesheets and XPATH expressions.
You can export the entire design of a NTF/NSF as XML. Read the documentation about the NotesNoteCollection class and its properties (“.SelectImageResources” or “.SelectScriptLibraries” sure sound they are related to design elements, don’t they…) and how export it via the DXLExporter class. (In case the “DXL” in DXLExporter still irritates you, the class is a subclass of the NotesXMLProcessor class…there is the “XML” for you
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
The system cannot locate the resource specified. Error processing resource ‘xmlschemas/domino_6_5.dtd’. Error processing resource ‘file:///C:/sampleDXL.xml’. Line 2, Position 55
Am I right in assuming that I am missing ‘xmlschemas/domino_6_5.dtd’?
That is correct. Move the file to your Notes program directory, and it will probably open in IE just fine. Or create a folder off your root called “xmlschemas” and put the DTD in there. Or edit the sampleDXL.XML file with a text editor and put the full path of the DTD in the .XML file.
That being said, IE is not the planet’s best XML validator. I’d suggest getting a real XML text tool.
I’d also suggest opening the file in a TEXT EDITOR as I originally described, rather than a web browser. I know that you can use IE for this, and I frequently have, but XML, like HTML, is fundamentally text data, and you will be able to see the logical structure of it.
You might, by the way, want to do this with a relatively simple database design, as the XML export of complex background images or Lotusscript agents can be intimidating.
Again, what’s wrong with DXL? Do you have something against those three letters? Since the Domino design really only makes sense in the Domino context, then the DXL DTD is THE correct XML DTD to use for design export. Use the NotesNoteCollection class to get the design elements you want for export, then stream them out. If you want to modify the output for some reason, such as in order to put each design note into its own, private document root element, then you can always use the NotesDOMParser or NotesSAXParser classes (or use XSLT if that’s your bag) to change the XML output.