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

  • Home
  • SEARCH
  • 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 4099290
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:24:53+00:00 2026-05-20T20:24:53+00:00

I get a XML Response from a PHP Script which I access using [lastResult]

  • 0

I get a XML Response from a PHP Script which I access using [lastResult] property.
The problem is the follwing:
XML Structure:

<Main>
  <Category1>
    <Data Name="Data1">
      <Item>
        <Name>foo</Name>
        <Info>bar</Info>
      </Item>
      <Item>
        <Name>baz</Name>
        <Info>FOO</Info>
      </Item>
    </Data>
    <Data Name="Data2">
    </Data>
  </Category1>
  <Category2>
    </Category2>
</Main>

Now I specify the dataProvider for the DataGrid as

'lastResult.Category1.Data.(@Name == "Data1").Item'

This works fine enough & my data is correctly outputted. The only thing I need is that how can I access the @Name property of the <Data> tag.
I can output Name & Info of Items by specifying:

'Name'
'Info'

But I’m clueless how to specify the @Name attribute of the parent <Data> tag when I’ve selected Data.Item as the dataProvider.

From what I can make of it, I need to go up 1 level to the parent node, but I couldn’t find any reference so as how to go up one level while using [lastResult] dataProvider (all were using XMLListCollection::parent())
Any help is appreciated.

Regards,
Nisheeth Barthwal

  • 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-20T20:24:54+00:00Added an answer on May 20, 2026 at 8:24 pm

    lastResult.Category1.Data.(@Name == "Data1").Item gives you XMLList of Items found in Data1. Each item is of type XML and you can call parent() function get parent node:

    //get first item
    var item:XML = lastResult.Category1.Data.(@Name == "Data1").Item[0];
    trace("Data.@Name: " + item.parent().@Name);
    

    Edit: to make it work inside DataGrid, you need to use labelFunction property of column. Set it to this:

    function formatItem(item:Object, column:DataGridColumn):String {
        return (item as XML).parent().@Name;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using curl to get an xml response from a payment gateway
I am using saxparser in order to get xml tag contents from file. All
I am facing problems in sending json response to php that I get from
I am using eval to create an associative array from php built in xml
I'm trying to create a PHP script which pulls xml data (text and images)
I need to access the response from a .NET web service which returns data
I get following XML string as a response from BING (Note:COMPOSITE result), i tried
I'm working with XML data from an application where we get XML like this:
I have a few windwos services. They get xml column from Sql server manipulate
I am calling oracle package, to get xml file from the package into oracleDataReader.

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.