Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6203195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:52:16+00:00 2026-05-24T04:52:16+00:00

Using e4x in flex: var attr : String = foo; var xml : XML

  • 0

Using e4x in flex:

var attr : String = "foo";
var xml : XML = 
    <resultSet>
       <node foo="1"/>
    </resultSet>;

How can I use the variable “attr” to access

xml.node.@foo 

I thought I could do it with

xml.node.@[attr]

But this doesn’t seem to work. How can I access this attribute by a dynamic value like this?

EDIT:
Both

xml.node.@[attr];

and

xml.node.attribute(attr);

work, as Constantiner suggested.

Updates:

Say I have an XMLList in this form:

var bar:XML = 
    <resultSet>
         <node>value</node>
    </resultSet>;

I want to filter the original xml above by matching “foo” attributes with the “value” from node in bar.

Essentially I want a sublist of the original xml such that

xml.node.@foo == bar.value 

for each xml row in the original value

As Constantiner mentioned, I can filter the original list by the value in foo, but what if I want to filter on multiple values?

Can I do something like:

xml.node.(bar.node.contains(attribute(foo)) ? attribute(foo) : null);

Or perhaps a cleaner method instead of the null?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:52:17+00:00Added an answer on May 24, 2026 at 4:52 am

    Try to use xml.node.attribute(attr).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using E4X to bind some values from xml in flex 3. There
I'm building a Flex/Flash Builder 4 application that loads data using E4X/XML, like this:
Using PyObjC , you can use Python to write Cocoa applications for OS X.
In Flex, I have an xml document such as the following: var xml:XML =
I'm trying to use e4x to retrieve xml from the result event thrown when
I'm using e4x to generate a HTML-snippet for my users which they can copy
I have some xml and I am trying to filter it using e4x. My
If I want to create: <foo> <bar>example1</bar> <bar>example2</bar> </foo> using e4x, and I already
Here is the XML How using E4X read values of nodes <status>௵௸</status> and of
Using MVC 3 Razor, how can I specify a variable within a call to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.