我希望将此代码从 Lotus Script 更改为 SSJS。
Query = "test"
Maxdocs = 10
Sortoption = 32
Otheroptions = 8192
Start = 1
Count = 30
Entryform = "ResultEntry"
Set RetDoc = curDB.Ftdomainsearch(Query, Maxdocs, Sortoption,Otheroptions,Start,Count,Entryform)
'domino Xml
Set ndxl = ss.CreateDXLExporter(Retdoc)
Set stream = ss.CreateStream
Call ndxl.SetOutput(stream)
ret = ndxl.Export(Retdoc)
Set domParser=ss.CreateDOMParser(ret, stream)
domParser.Process
'doclink
Set rootElement = domParser.Document.DocumentElement
Set docList = rootElement.GetElementsByTagName ("doclink")
=================================
我自己创建了这个 ssjs 代码。但是发生了错误。
var Query = "a";
var Maxdocs = 10;
var Sortoption = 32;
var Otheroptions = 8192;
var Start = 1;
var Count = 30;
var Entryform = "ResultEntry";
var RetDoc:NotesDocument = database.FTDomainSearch(Query, Maxdocs, Sortoption,Otheroptions,Start,Count,Entryform);
var stream:NotesStream = session.createStream();
var ndxl:NotesDxlExporter = session.createDxlExporter();
var ret:string = ndxl.exportDxl(RetDoc);
var parser = new DOMParser();
var doc = parser.parseFromString(ret, "application/xml");
var rootElement = doc.DocumentElement;
var docList = rootElement.GetElementsByTagName ("doclink");
====================================
该错误如下所述。
" DOMParseris not found" 一句错误 var parser = new DOMParser();
请告诉我 ssjs 中的正确代码。