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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:24:22+00:00 2026-05-17T00:24:22+00:00

I want to be able to do something like var XMLquery:String = a1.a2.a3; var

  • 0

I want to be able to do something like

var XMLquery:String = "a1.a2.a3";
var parserVal:XML = parserMethod(XMLquery);
// or
var parserVal:XMLList = parserMethod(XMLquery);`

and get an output something like

<a3>Some value</a3>

Important: And I want to be able to replace the output at a1.a2.a3 so using descendants is out of question. 🙁

So it’s basically the ability to call xml query in string. Is there a way to do this. Just a hint would be super, I can do it if I got a bit of head-start.

Thank you!


I think I found a solution with the help from this link:

Updating an actionscript xml object directly in one line using e4x?

public static function updateXml(xml:XML, path:String, data:XMLList = null,update:Boolean = false,XmlListOnly:Boolean = false):* {
            var nodesArray:Array = path.split(".");
            var tempXML:XML = xml;
            var tempXMLCandidate:XML;
            var tagName:String;
            for (var i:int = 0; i < nodesArray.length; i++){
                tagName = nodesArray[i];
                if (i == nodesArray.length - 1){
                    if (data != null && update && !XmlListOnly){
                    tempXML[tagName] = data;
                    }else if (XmlListOnly){
                        return tempXML[tagName];
                    }else{
                    return tempXML[tagName].length();
                    }
                }else{
                    tempXMLCandidate = tempXML[tagName][0];
                    if (!tempXMLCandidate){
                        tempXML.appendChild(tempXMLCandidate);
                    }
                tempXML = tempXMLCandidate;
                }
            }
            return tempXML;
        }

You can call it like this:

updateXml(xmlHold, "words.exercise", sortedXmlList, true);
  • 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-17T00:24:23+00:00Added an answer on May 17, 2026 at 12:24 am

    I’m too lazy to code and test it, but here’s idea:

    • Break your query on parts "a1.a2.a3".split(".")
    • Go on the parts, calling xml.elements(parts[i]) (you’ll need extra (maybe nested) function for recursive calls)
    • If you get non-empty XMLList, repeat calling elements on that list using next part.
    • On last part, extract text from it with children()[0].
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to do something like this: var MyObject = function(prop)
I want something like a canvas, but where i'd be able to manipulate pixels
I want to be able to get something similar to this.. I want to
I don't seem to be able to define something like: var a = {-1:
I want to do something like this: var w = window.open(javascript: makeAnAjaxRequest();); My question
I want to be able to download a URL in C++. Something as simple
I'm using LaTeX and BibTeX for an article, and I want to able to
Want to be able to provide a search interface for a collection of objects
I want to be able to take an image that i have already captured
I want to be able to replicate only the folder structure (not the contents)

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.