Domino 9 und frühere Versionen > ND6: Entwicklung
RichText in RichText EINFÜGEN
eknori (retired):
kann ich dir frühestens heute abend schicken; heute ist wieder Grosskampftag in der Firma ( Helpdesk Schulung *grins* )
eknori (retired):
Axel: du kannst aber auch direkt in eine Datei streamen. Da brachst du dann einen outputStream, . Dem DOMParser teilst du dann diesen output mit setOutput ( stream ) mit.
Das mit dem RTITEM habe ich deshalb gemacht, damit ich mir die Änderungen direkt im Dokument ansehen kann.
animate:
Das Zauberwort heißt Pipelining. Wenn du das verstanden hast ist alles ganz einfach :)
Zitat von hier
--- Zitat ---Pipelining works because the XML processors require you to identify input and output before you call the Process method on the first object in the line. The simplest way to set up a pipeline is to specify the inputs for all the processes, but no outputs except for the output of the last process in the line.
--- Ende Zitat ---
Und von hier.
--- Zitat ---The whole point of a pipeline is that it all runs at the same time. It does not process each stage separately. Set the pipleine up, then call Process on the first stage in the pipeline. Do not call Process on the other stages. The first stage pushes the data through all the stages that you have set up.
--- Ende Zitat ---
Beiträge im Forum von diesem Rod Whiteley zum Thema DXL kann ich nur empfehlen. Die haben mir immer sehr geholfen.
eknori (retired):
Stümmt, bin auch auch gerade drauf gestossen ::)
eknori (retired):
*HaareRauf* Gerade, als ich dachte, ich hätte das Pipelining verstanden, .... bin ich so schlau als wie zuvor .
Der Exporter übergibt an den Parser, der Parser parsed, übergibt aber nicht an den Importer ( so sieht es zumindest aus ) Der Code läuft fehkerfrei durch. Im Debugger sieht man auch, daß
--- Zitat ---parnode.FirstChild.NodeValue = "Hallo Welt"
--- Ende Zitat ---
gesetzt wird. Also müsst edoch das Document aktualisiert werden. ???
Das ist das "Dumme" beim Pipeline; man sieht irgendwie nicht mehr, was passiert ...
--- Code: ---Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim rootElement As NotesDOMElementNode
Dim docList As NotesDOMNodeList
Dim node As NotesDOMNode
Dim nodeChildOfRTOne As NotesDOMNode
Dim nodeChildRichText As NotesDOMNode
Dim eNode As NotesDOMElementNode
Dim parNode As NotesDOMElementNode
Dim cloneNode As NotesDOMNode
Dim i As Integer
Dim dc As NotesDocumentCollection
Set dc = db.UnprocessedDocuments
If dc.Count = 0 Then
Messagebox "No document selected",, "No document"
Exit Sub
End If
Dim doc As NotesDocument
Set doc = dc.GetFirstDocument
Dim exporter As NotesDXLExporter
Dim domParser As NotesDOMParser
Set exporter = session.CreateDXLExporter
Set domParser=session.CreateDOMParser
Call exporter.SetInput ( doc )
Call exporter.SetOutput ( domParser )
Call exporter.process
Set rootElement = domParser.Document.DocumentElement
Set docList = rootElement.GetElementsByTagName ( "item" )
If docList.NumberOfEntries = 0 Then : Exit Sub
For i = 1 To docList.NumberOfEntries
Set node = docList.GetItem( i )
Set enode = node
If enode.GetAttribute("name") = "RTONE" Then
If enode.hasChildNodes Then
Set nodeChildOfRTOne = enode.FirstChild
While Not (nodeChildOfRTOne.isNull)
If nodeChildOfRTOne.NodeName = "richtext" Then
If nodeChildOfRtOne.hasChildNodes Then
Set nodeChildRichText = nodeChildOfRTOne.FirstChild
While Not (nodeChildRichText.IsNull)
If nodeChildRichText.NodeName = "par" Then
Set parnode = nodeChildRichText
If ( Not parNode.FirstChild.IsNull ) Then ' skip NULL Values
If parnode.FirstChild.NodeValue = "RT:RTONE" Then
parnode.FirstChild.NodeValue = "Hallo Welt"
Msgbox "HEUREKA"
Else
End If
End If
End If
Set nodeChildRichText = nodeChildRichText.nextSibling
Wend
End If
End If
Set nodeChildOfRTOne = nodeChildOfRTOne.nextSibling
Wend
End If
End If
Next
Dim importer As NotesDXLImporter
Set importer = session.CreateDXLImporter
Call importer.SetInput ( domParser )
Call importer.SetOutput ( db )
End Sub
--- Ende Code ---
Navigation
[0] Themen-Index
[#] Nächste Seite
[*] Vorherige Sete
Zur normalen Ansicht wechseln