Hi everyone,
I kept getting errors with NotesDXLImporter. I am using it to update a document in a Notes database, like this;
-
Select a Notes document in a database
-
doc → NotesDXLExporter → NotesDOMParser
-
Add and remove some nodes in the DOMParser document
-
DOMParser.Serialize() → NotesStream → NotesDXLImporter → doc
(The reason for using the DXL methods is that I have had awful bother with NotesEmbeddedObject.Remove(), so I am trying to use the DXL methods to achieve the same end.)
Just as an experiment I dropped step 3. So now I just export the document into NotesDOMParser, then import it straight back without changing anything. I am still getting the same error in NotesDXLImporter.
The only thing I can think of is that the NotesStream in step 4 needs to be set to a particular character set, but I cannot figure out the one to choose. Does anyone have a suggestion?
Here is the relevant part of my testing code;
Private Function DeleteAttachments( docFrom As NotesDocument ) As Boolean
Dim as New NotesSession
Dim DOMParser As NotesDOMParser
Dim DXLExporter As NotesDXLExporter
Set DOMParser = s.CreateDOMParser()
Set DXLExporter = s.CreateDXLExporter( docFrom, DOMParser )
Call DXLExporter.Process()
’ TEST just push the DXL straight back again to see if we get errors
Dim dxlstream As NotesStream
Dim DXLImporter As NotesDXLImporter
Set dxlstream = s.CreateStream()
Call DOMParser.Setoutput( dxlstream )
Call DOMParser.Serialize()
Set DXLImporter = s.CreateDXLImporter( dxlstream, docFrom.ParentDatabase )
DXLImporter.DocumentImportOption = DXLIMPORTOPTION_REPLACE_ELSE_IGNORE
Call DXLImporter.Process() ' <== ERROR HERE
Immediately before the failure, the properties of the NotesStream are;
charset: x-lmbcs
bytes: 14784530
The Notes document is a big one with attachments and embedded graphics, but no embedded OLE objects
Here is NotesDXLImporter.Log;
<?xml version='1.0'?>Encoding (utf-16, from XMLDecl or manually set) contradicts the auto-sensed encoding, ignoring it
Expected end of tag ‘run’
Unknown DXL class library error
DXL importer operation failed
I have the Notes 6.5.2 client, running on Windows XP.
Thank you for any advice (I hope this is crispy enough!), best wishes, Ian