在 Domino LotusScript 中读取远程 URL

发布于 2024-08-20 16:11:24 字数 157 浏览 6 评论 0原文

我有一个远程 RSS 提要,必须使用 LotusScript 将其转换为 Notes 文档。

我已查看文档,但找不到如何打开远程 URL 以检索其内容。换句话说,是某种类似 wget 或 curl 的功能。谁能阐明如何做到这一点?使用 Java 不是一个选择。

谢谢。

I have a remote RSS feed which has to be transformed into Notes documents using LotusScript.

I've looked through the documentation, but I can't find how to open a remote URL in order to retrieve its contents. In other words, some sort of wget- or curl-like functionality. Can anyone shed some light on how to do this? Using Java is not an option.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

千纸鹤带着心事 2024-08-27 16:11:24

查看 LotusScript 中提供的 NotesDOMParser 类,它允许您(间接)从远程 URL 提取 XML 并在 XML DOM 对象中进行处理。

您可以使用 MSXMLHTTP COM 对象将 XML 拉入字符串,然后使用 NotesStream 将 XML 发送到 NotesDOMParser。

我没有测试过,但代码看起来像这样:

...
Set objXML = CreateObject("Microsoft.XMLHTTP")
objXML.open "GET", sURL, False, "", ""
objXML.send("")
sXMLAsText = Trim$(objXML.responseText)

Set inputStream = session.CreateStream
inputStream.Open (sXMLAsText)
Set domParser=session.CreateDOMParser(inputStream, outputStream)
domParser.Process
...

文档:http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/index.jsp?topic=/com.ibm.designer。 domino.main.doc/H_NOTESDOMPARSER_CLASS.html

Check out the NotesDOMParser class - available in LotusScript - which lets you (indirectly) pull XML from a remote URL and process in a an XML DOM object.

You can pull the XML into a string using the MSXMLHTTP COM object, then use NotesStream to send the XML to the NotesDOMParser.

I have not tested, but the code would look something like this:

...
Set objXML = CreateObject("Microsoft.XMLHTTP")
objXML.open "GET", sURL, False, "", ""
objXML.send("")
sXMLAsText = Trim$(objXML.responseText)

Set inputStream = session.CreateStream
inputStream.Open (sXMLAsText)
Set domParser=session.CreateDOMParser(inputStream, outputStream)
domParser.Process
...

Documentation: http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/index.jsp?topic=/com.ibm.designer.domino.main.doc/H_NOTESDOMPARSER_CLASS.html

寂寞花火° 2024-08-27 16:11:24

您无法使用本机 Lotusscript 打开远程 URL(无论是 HTTP 还是其他协议):对象库根本不支持它。如果您在 Windows 服务器上运行,则应该能够使用 MS XMLHttp DLL 通过 URL 获取远程文件的句柄,如前面的答案所指定。 (或者,此链接指定如何解析和使用 Lotusscript 打开 UNC 路径(同样,仅限 Windows)。

话虽如此,如果我理解正确的话,您根本就没有使用 HTTP 来访问远程文件。如果RSS文件只是在一个简单的路径上,为什么不能用Lotusscript以正常方式打开该文件进行解析?

You can't open a remote URL (whether it's HTTP or some other protocol) using native Lotusscript: the object library simply doesn't support it. If you're running on a Windows server, you should be able to use the MS XMLHttp DLLs to get a handle on your remote file via a URL, as specified by the previous answer. (Alternatively, this link specifies how to parse and open a UNC path with Lotusscript—again, Windows only).

All that said, if I understand you correctly, you're not using HTTP to access the remote file at all. If the RSS file is just on a simple path, why can't you open the file for parsing in the normal way with Lotusscript?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文