是否进行“标签搜索”? Flex 中存在使用 RDF/XML 文档的方法吗?

发布于 2024-07-13 07:55:21 字数 319 浏览 4 评论 0原文

我正在我的应用程序中处理 RDF 文件。 我使用 URLLoader 加载它,并导入 flash.xml.* 类,以便操作 RDF 文件的内容。 我需要以有效的方式计算某些标签(“描述”)。 我正在搜索的标签数量是可变的,现在我在 while cicles 中使用firstChild、lastChild、nextSibling 方法的组合,以便从文档中获取我需要的信息。 我的问题是是否有一种更直接和更通用的“搜索方法”可以帮助我避免我所做的复杂而不优雅的搜索。 @Property 语法用于直接访问标签的属性,对吗? 您认为这对我解决问题有用吗? 谢谢大家的帮助,

大卫

I'm working on a RDF file in my application. I loaded it with the URLLoader and I've imported flash.xml.* class in order to manipulate the content of my RDF file. I need to count certain tags ("Description") in an efficient way. The number of the tags I'm searching for is variable and now I'm using a combination of methods firstChild, lastChild, nextSibling in while cicles in order to take the informations I need from the document. My question is if there's a more direct and general "search method" that helps me avoid that complex and not elegant search that I made.
The syntax @Property is used to directly access a Tag's property, right? Do you think that it could be useful for me to solve my problem?
Thank you all for the help

David

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

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

发布评论

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

评论(1

旧人九事 2024-07-20 07:55:22

当然。 试试这个:

// assuming xml is the XML object containing your document
var numberOfDescriptionElements:int = xml..Description.length();

一般来说,您应该查看 E4X(ECMAScript for XML)的详细信息,它是一种非常方便且简洁的 ActionScript 子语言,用于访问 XML 结构。

Sure. Try this:

// assuming xml is the XML object containing your document
var numberOfDescriptionElements:int = xml..Description.length();

In general, you should check out the details of E4X (ECMAScript for XML), a very handy and consise sub-language of ActionScript to access XML structures.

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