简体   繁体   中英

c# open exported DXL as NotesDocument

Does any1 know, if it is possible to open a DXL (Domino XML) as a NotesDocument object?

When a Notes client is installed you can add a reference to "Interop.Domino" and use the Domino objects with C#. Infact I have tried some DXLImporter stuff, but with no luck ... It seems, that the DXLImporter only can import into NotesDatabases.

Is there a way to open up a DXL exported file (NotesStream) as a NotesDocument to access the content as Notes objects? (esp. Richtext)

Any idea? Big thanks.

// SiL

A NotesDocument- Object can never stand alone. It always needs a parent database. This is true no matter how you get the NotesDocument object. In your special case you need a "dumb" container nsf that you use to import the XML to. After importing you can access the NotesDocument.

You need to find the document using its universalid. This universalid can be found in the XML as "unid"- Property of the nodeinfo- node:

<document xmlns='http://www.lotus.com/dxl' version='9.0' maintenanceversion='1.4' 
  replicaid='C1257C270049C111' form='Offer'>
  <noteinfo noteid='188a6' unid='FE4CB54C2D7C9ABCC1257E620027FCE4' sequence='3'>

As stated by Stan in the comments this might or might not work. An imported document can get a different Universalid if a document with that UNID already exists and/or import- options are set accordingly. Better user NotesDXLExporter.GetFirstImportedNoteID to get the document.

You could even import the whole database from an xml- struct, but that might be to much overhead for such a simple task, but of course it depends on your needs.

as a "hack" or "workaround" you could import this document to a database, that is always there on any Lotus Notes Client, eg the bookmark.nsf or the names.nsf, but I would not recommend to do so.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM