ActionScript E4X 获取标签属性
对于 E4X,我是一个真正的新手,所以请耐心等待。我正在开发一个 ActionScript 3.0 项目,我想从 XML 标记中提取所有属性。
我使用了 XML.attributes()
方法,但只返回每个属性的值/我希望获取所有属性名称和 给定 XML 标记的属性值。
有人可以告诉我如何获得这个吗?
谢谢您的宝贵时间,
斯普里诺724
I am a real newbie when it comes to E4X, so please bear with me. I am working on an ActionScript 3.0 project which I would like to extract all of the attributes from an XML tag.
I have used the XML.attributes()
method, but that only returns the value of each attribute/ I would like the to get all of the attribute names and attribute values for a given XML tag.
Could someone please show me as to how I could obtain this?
Thank you for your time,
spryno724
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Google 是你的朋友
Google is your friend
XML.attributes()
不仅返回值,您还只是看到属性的字符串序列化。给定attr =.attributes()[0]
、attr.localname() === "bar"
和attr.toString() === "baz"
。XML.attributes()
doesn't only return the value, you're just seeing the string serialization of the attributes. Givenattr = <foo bar="baz"/>.attributes()[0]
,attr.localname() === "bar"
andattr.toString() === "baz"
.