Lotus Notes and C#: NotesRichTextItem how to recreate content or loop through elements in respective order -


i exporting lotus notes database using c# interop domino assembly nuget,

i haven't found way identify objects or elements in notesrichtextitem in order entered, example, maybe enter paragraph first, table , attachment. there way loop through elements in respect order ?

i have found way find elements findfirstelement, have pass element type looking for, difficult extracting elements without order make content lose context.

thanks

there way analyze notes document's richtext items using dxl - special xml format notes. use dxlexporter export notes document dxl format. can "walk" through xml , content of richtext item elements in right order.

for richtext item e.g.

enter image description here

you'd dxl

<item name='body'>     <richtext>         <pardef id='1'/>         <par def='1'>aaaaaaa</par>         <table widthtype='fixedleft' refwidth='1.0667in'>             <tablecolumn width='0.6729in'/>             <tablecolumn width='0.3938in'/>             <tablerow>                 <tablecell>                     <pardef id='3' keepwithnext='true' keeptogether='true'/>                     <par def='3'>111</par></tablecell>                 <tablecell>                     <pardef id='4' keepwithnext='true' keeptogether='true'/>                     <par def='4'>222</par></tablecell>             </tablerow>             <tablerow>                 <tablecell><par def='3'>333</par></tablecell>                 <tablecell><par def='4'>444</par></tablecell>             </tablerow>         </table>         <pardef id='5' leftmargin='1.2500in' list='bullet'/>         <par def='5'>xxx</par>         <par def='5'>yyy</par>         <par def='5'>zzz</par>         <pardef id='6' leftmargin='1in'/>         <par def='6'>             <attachmentref name='icon16.gif' displayname='icon16.gif'>                 <picture height='34px' width='61px'>                     <notesbitmap>lqamaaaaaaaaaaaaa...</notesbitmap>                     <caption>icon16.gif</caption>                 </picture>             </attachmentref>         </par>     </richtext> </item> 

here java agent exports selected documents file.

import lotus.domino.*;  public class javaagent extends agentbase {      @override     public void notesmain() {          try {             session session = getsession();             agentcontext agentcontext = session.getagentcontext();             documentcollection dc = agentcontext.getunprocesseddocuments();             string filename = "c:/temp/exportdocs.dxl";             stream stream = session.createstream();             if (stream.open(filename)) {                 stream.truncate();                 dxlexporter exporter = session.createdxlexporter();                 exporter.setrichtextoption(0);                 exporter.setmimeoption(0);                 stream.writetext(exporter.exportdxl(dc));             } else {                 system.out.println("cannot open " + filename);             }         } catch (exception e) {             e.printstacktrace();         }     } } 

Comments