nsIFeedProcessor 编辑

toolkit/components/feeds/public/nsIFeedProcessor.idlScriptable This interface parses RSS or Atom feeds, triggering callbacks based on their contents during and after the processing. 1.0 66 Introduced Gecko 1.8.1 Inherits from: nsIStreamListener Last changed in Gecko 1.8.1 (Firefox 2 / Thunderbird 2 / SeaMonkey 1.1)

Implemented by: @mozilla.org/feed-processor;1. To create an instance, use:

var feedProcessor = Components.classes["@mozilla.org/feed-processor;1"]
                   .createInstance(Components.interfaces.nsIFeedProcessor);

Method overview

void parseAsync(in nsIRequestObserver requestObserver, in nsIURI uri);
void parseFromStream(in nsIInputStream stream, in nsIURI uri);
void parseFromString(in AString str, in nsIURI uri);

Attributes

AttributeTypeDescription
listenernsIFeedResultListenerThe feed result listener that will respond to feed events.

Methods

parseAsync()

Parses a feed asynchronously. The caller must then call the processor's nsIStreamListener methods to drive the parsing process. You must not call any of the other parsing methods on the nsIFeedProcessor interface during an asynchronous parse.

 void parseAsync(
   in nsIRequestObserver requestObserver,
   in nsIURI uri
 );
Parameters
requestObserver
The observer to be notified when parsing starts and stops. This can be null.
uri
The base URI against which any URIs in the feed are resolved.

parseFromStream()

Parses a feed from an nsIInputStream.

 void parseFromStream(
   in nsIInputStream stream,
   in nsIURI uri
 );
Parameters
stream
Pointer to the nsIInputStream from which to read and parse the feed.
uri
The base URI against which any URIs in the feed are resolved.

parseFromString()

Parses a feed from an AString.

 void parseFromString(
   in AString str,
   in nsIURI uri
 );
Parameters
str
The string to parse as a feed.
uri
The base URI against which any URIs in the feed are resolved.

See also

Interwiki link

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:41 次

字数:4789

最后编辑:8年前

编辑次数:0 次

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