例: NamespaceURI property

次のエージェントはノードについての名前空間情報を表示します。

Sub Initialize
  Dim session As NotesSession
  Dim db As NotesDatabase
  Dim inputStream As NotesStream
  Dim domParser As NotesDOMParser

  On Error Goto errh
  Set session = New NotesSession
  Set db = session.CurrentDatabase
  Set inputStream = session.CreateStream
  inputStream.Open ("c:¥dxl¥namespace.xml")
  Set domParser=session.CreateDOMParser(inputStream)
  domParser.DoNamespaces = True
  domParser.Process
  Call walkTree(domParser.Document)

results:
  Exit Sub
errh:
  Messagebox Cstr(Err) + ":  " + Error + Chr(13)
  Resume results
End Sub

Sub walkTree ( node As NotesDOMNode)
  Dim child As NotesDOMNode
  Dim n As Integer

  REM Report on the namespace
  If node.NamespaceURI <> "" Then
    Messagebox  _
    "NamespaceURI = " & node.NamespaceURI & Chr(13) & Chr(10) & _
    "Local name = " & node.LocalName & Chr(13) & Chr(10) & _
    "Prefix = " & node.Prefix, , "Node: "& node.NodeName
  End If

  Set child = node.FirstChild
  n = node.NumberOfChildNodes
  While n > 0
    Call walkTree(child)
    Set child = child.NextSibling
    n = n - 1
  Wend
End Sub