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 7417535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:43:13+00:00 2026-05-29T07:43:13+00:00

Follow up question on Filtering XML based on multiple params – Flex . I

  • 0

Follow up question on Filtering XML based on multiple params – Flex.

I was trying to create the Query part dynamically so that params and the keys take over for building the criteria part. Just to show:

 //building a dynamic query like this 
var q1:String = "descendants (\"E1" ) == \"111\" )"; 
Alert.show("Query>>"+q1.toString());     // Output: descendants ("E1" ) == "111"

var r2:XMLList = xmlData..*.(descendants ("E1" ) == "111"); //returns correct result 
var r1:XMLList = xmlData..*.(q1.toString());  // weird response, 
                                              // doesn't filter out anything

A comment here Filtering XML based on multiple params – Flex says that the expression inside the parentheses should not be a string. Agreed.

So, is there any other approach to filter out multiple parameters in XML than to use the
descendants(), which currently is not working out because we are building the search query dynamically, based on the params searched?

Any pointers/ideas would be of great help.

  • 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-29T07:43:14+00:00Added an answer on May 29, 2026 at 7:43 am

    How about doing the filtering in a loop?

    var filters : Array = [ { key : "E1", value : "333" }, { key : "D1", value : "333" } ];
    
    var searchItem : XMLList = xmlData.*;
    for each (var filter:Object in filters)
        searchItem = searchItem.( descendants ( filter.key ) == filter.value);
    
    trace (searchItem);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a follow up question to T-Sql xml query If I add a
This is a follow up question to that at Can I create a HTML
guys! I have follow question. I am writing an application that will track movement
This question is a follow-up question to my previous one that can be found
This is a follow-up question to Merging multiple encoded polylines into one encoded polyline
I have a follow-on question to How to display an image based on SelectedValue
A follow up question concerning the DAL layer part .. The first question about
This is a follow-up question to this other one . I am trying to
As a follow-up question to a previous post: filtering content for UITableView When filtering
Follow-up question to [Does casting to a pointer to a template instantiate that template?]

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.