专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Lotus

LotusScript如何生成一个XML文件

发布时间:2010-06-13 13:52:56 文章来源:www.iduyao.cn 采编人员:星星草
LotusScript怎么生成一个XML文件
如题。
JS中这是这样生成的:
<script>var fso=new ActiveXObject("Scripting.FileSystemObject");
var f1=fso.createtextfile("c:\\xmldom.xml");</script>
LotusScript中要如何实现?

------解决方案--------------------
参考NotesDOMParser的SetInput方法,有举例如下:
VB code

This agent generates DXL based on the content of a document collection.
Sub Initialize
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Set db = session.CurrentDatabase
  
  REM Open xml file named after current database
  Dim stream As NotesStream
  Set stream = session.CreateStream
  filename$ = "c:\dxl\" & _
  Left(db.FileName, Len(db.FileName) - 4) & "_dc.xml"
  If Not stream.Open(filename$) Then
    Messagebox "Cannot open " & filename$,, "Error"
    Exit Sub
  End If
  Call stream.Truncate
  
  REM Create document collection
  Dim dc As NotesDocumentCollection
  Set dc = db.AllDocuments
  If dc.Count = 0 Then
    Messagebox "No document in database",, "No document"
    Exit Sub
  End If
  
  REM Export document collection as DXL
  Dim exporter As NotesDXLExporter
  Set exporter = session.CreateDXLExporter
  Call exporter.SetInput(dc)
  Call exporter.SetOutput(stream)
  Call exporter.Process
End Sub
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: