Irgendwie stehe ich mit XML und dem DOMParser auf Kriegsfusß.
Ich habe folgenden XML Export meines Dokuments
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE document SYSTEM 'xmlschemas/domino_7_0.dtd'>
<document xmlns='
http://www.lotus.com/dxl' version='7.0' replicaid='C125715F002D73D1'
form='Sample'>
<noteinfo noteid='916' unid='7EE586C3D6B725CCC1257160004210E3' sequence='26'>
<created><datetime dst='true'>20060430T140136,99+02</datetime></created>
<modified><datetime dst='true'>20060501T143234,46+02</datetime></modified>
<revised><datetime dst='true'>20060501T143234,45+02</datetime></revised>
<lastaccessed><datetime dst='true'>20060501T143234,45+02</datetime></lastaccessed>
<addedtofile><datetime dst='true'>20060430T140144,62+02</datetime></addedtofile></noteinfo>
<updatedby><name>CN=Heinz Ulrich Krause/O=Witte/C=de</name></updatedby>
<revisions><datetime dst='true'>20060430T140144,62+02</datetime><datetime
dst='true'>20060430T140243,32+02</datetime><datetime dst='true'>20060430T140318,98+02</datetime><datetime
dst='true'>20060430T140350,65+02</datetime><datetime dst='true'>20060430T140423,73+02</datetime><datetime
dst='true'>20060430T144720,51+02</datetime><datetime dst='true'>20060430T153953,81+02</datetime><datetime
dst='true'>20060430T154101,45+02</datetime><datetime dst='true'>20060430T154103,21+02</datetime><datetime
dst='true'>20060430T154143,04+02</datetime><datetime dst='true'>20060430T154235,77+02</datetime><datetime
dst='true'>20060430T154437,24+02</datetime><datetime dst='true'>20060430T154904,73+02</datetime><datetime
dst='true'>20060430T155631,37+02</datetime><datetime dst='true'>20060430T160359,38+02</datetime><datetime
dst='true'>20060430T162002,11+02</datetime><datetime dst='true'>20060430T162040,60+02</datetime><datetime
dst='true'>20060430T162107,21+02</datetime><datetime dst='true'>20060430T163828,93+02</datetime><datetime
dst='true'>20060501T094942,46+02</datetime><datetime dst='true'>20060501T095028,39+02</datetime><datetime
dst='true'>20060501T101412,59+02</datetime><datetime dst='true'>20060501T104914,32+02</datetime><datetime
dst='true'>20060501T114738,49+02</datetime><datetime dst='true'>20060501T115259,27+02</datetime></revisions>
<item name='OriginalModTime'><datetime dst='true'>20060501T143234,44+02</datetime></item>
<item name='RTONE'>
<richtext>
<pardef id='1'/>
<par def='1'>TEST</par>
<par def='1'/>
<par def='1'><<RT:RTTWO>></par><par def='1'/>
<par def='1'>noch mehr Text</par>
</richtext>
</item>
<item name='RTTWO'><richtext>
<pardef id='2'/>
<par def='2'/></richtext></item>
<item name='TextField'><text/></item>
</document>
Ich möchste gerne an fir fett markierte Stelle navigieren, um diesen Node durch einen Node aus einem anderen Dokument zu ersetzen.
Ich kann auch mit folgendem Code mein RichtextFeld ( RTONE ) im Code anspringen ( also offensichtlich das <item name="RTONE"> )
Sub Click(Source As Button)
Dim session As NotesSession
Dim db As NotesDatabase
Dim inputStream As NotesStream
Dim domParser As NotesDOMParser
Dim rootElement As NotesDOMElementNode
Dim docList As NotesDOMNodeList
Dim node As NotesDOMNode
Dim eNode As NotesDOMElementNode
Dim i As Integer
Dim origXML As String
origXML = "c:\RichText.xml"
Set session = New NotesSession
Set db = session.CurrentDatabase
Set inputStream = session.CreateStream
inputStream.Open (origXML)
Set domParser=session.CreateDOMParser ( inputStream )
domParser.Process
Set rootElement = domParser.Document.DocumentElement
Set docList = rootElement.GetElementsByTagName ( "item" )
If docList.NumberOfEntries = 0 Then
Messagebox "No <item> element nodes in file", , "Error"
Exit Sub
End If
For i = 1 To docList.NumberOfEntries
Set node = docList.GetItem( i )
Set enode = node
If enode.GetAttribute("name") = "RTONE" Then
Msgbox "found at position " & Cstr(i)
End If
Next
End Sub
Nur, wie komme ich jetzt weiter ? Wie gelange ich an die gewünschte Stelle ? Nach meiner Vorstellung müsste doch das NextChild von <item> <richtext> sein und dessen nextchild <pardef>, oder ?