Hi,
I’m fairly new to working with the notesDomParser, so maybe this question prooves te be really easy …
I have used the notesDomParser to transform XML (plain text in a rtf) into an xml-object in which I can search and replace values. Afterwards I would like to write the changed (in Memory) XML back into my rtf (again text). How do I use the parser and NotesStreams to get this done? (backend, data possibly over 64K)
Thnx,
Arthur
Subject: RE: notesDomParser basics?
You serialize into the NotesStream, read the text from the stream, remove the old rtitem, create a new one, and add the text in with AppendText or whatever NRTI method it is. Whether you need to worry about line breaks may depend on what version you’re using. Also note there’s a problem with apostrophes in attribute values in the dom parser serialize function, which is hard to work around, if your data is such that you may encounter it.
Subject: RE: notesDomParser basics?
Hi Andre, thnx for respondingSerializing into the Notesstream is still cryptic to me, but will probably do to get me started 
Since I’m controlling the content I am pretty sure I can avoid the apostrophes.
Greetz
Arthur
Subject: RE: notesDomParser basics?
almost there …
Like you pointed out I have
- re-created my RTF >>
call item.remove …
Set rtitem = doc.CreateRichTextItem( “xmltext” )
- read the stream and put it in the new RTF
Call doc.ReplaceItemValue(“xmltext”, outputStream.ReadText())
Two Questions remaining:
-
my new RTF is apparently saved as normal text and therefore no longer recognized by my code as Richtext
-
(how) can I add linebreaks, using the ReadText-method?
Much Obliged,
Arthur
Subject: RE: notesDomParser basics?
ReplaceItemValue clobbers the RT item you just created, replacing it with a text item. Use AppendText, as I already said.
Subject: RE: notesDomParser basics?
Thnx Andre, life can be really simple …