为什么我的 Atom 数据绑定不起作用?

发布于 2024-07-19 10:13:46 字数 660 浏览 6 评论 0原文

我有一个 Flex 应用程序,其中包含与 XML 和 Atom 提要绑定的高级数据网格。

使用我的 XML 文件,该应用程序运行得很好:

jiraList = new XMLList(event.result.channel.item);

但是,当我尝试访问 Atom feed 时,我不能低于“event.result”。

这可行:

clarityList = event.result as XMLList;
Alert.show(clarityList.toString());

但这不行:

clarityList = event.result.feed as XMLList;
Alert.show(clarityList.toString());

正如 Adob​​e 所解释的,我使用 Atom 命名空间:

private namespace atom = "http://www.w3.org/2005/Atom";
use namespace atom;

我的目标是能够将 Atom 提要与我的高级数据网格列绑定,因为它与我的 XML 提要一起使用。 我怎样才能做到这一点?

I've got a Flex application with Advanced Data Grids binded with XML and Atom feeds.

With my XML file, the application works very well:

jiraList = new XMLList(event.result.channel.item);

However, when I try to access Atom feeds, I cannot go lower than "event.result".

This works:

clarityList = event.result as XMLList;
Alert.show(clarityList.toString());

But this doesn't:

clarityList = event.result.feed as XMLList;
Alert.show(clarityList.toString());

As Adobe explains it, I use the Atom namespace:

private namespace atom = "http://www.w3.org/2005/Atom";
use namespace atom;

My goal is to be able to bind the Atom feed with my Advanced Data Grid Columns, as it works with my XML feed. How can I do this?

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

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

发布评论

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

评论(1

心清如水 2024-07-26 10:13:46
private namespace atom = "http://www.w3.org/2005/Atom";
use namespace atom;

clarityList = event.result.atom::feed as XMLList;
Alert.show(clarityList.toString());

命名空间必须用于限定属性(元素)访问。 ActionScript 属性名称实际上是命名空间限定的,但很少以这种方式使用。 可以说,XML 倾向于使这个主题“浮出水面”。

private namespace atom = "http://www.w3.org/2005/Atom";
use namespace atom;

clarityList = event.result.atom::feed as XMLList;
Alert.show(clarityList.toString());

Namespaces must be used to qualify the property (element) accesses. ActionScript property names are in fact namespace-qualified, but rarely used this way. XML tends to bring this topic "to the surface" so to speak.

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