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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:33:30+00:00 2026-05-15T13:33:30+00:00

I have have a problem loading and accessing data from a value object in

  • 0

I have have a problem loading and accessing data from a value object in my new project.. I load an xml file via a service, which contains title and locations of asset files, I need to be able to access the location of an asset file by specifying the title and retrieiving it from a value object.. I’m using the Robotlegs framework, here’s an example of the xml:

<?xml version="1.0" encoding="utf-8" ?>
<files id ="xmlroot">
<file title="css_shell"                 location = "css/shell.css"  />
<file title="xml_shell"                 location = "xml/shell.xml"  />
<file title="test"                      location=   "test/location/test.jpg" />
<file title ="shell_background_image"   location = "images/shell_images/background_image.jpg" />
</files>

I then push this data into a value object as a Dictionary hash.. hopefully

//-----------  populate value objects ------------------------------------
var xml:XML = new XML(xml);
var files:XMLList = xml.files.file;

for each (var file:XML in files) {
var filePathVO:DataVO = new FilePathVO( file.@title.toString(),
     file.location.toString()
);

 filePathModel.locationList.push(filePathVO);
filePathModel.locationHash[filePathVO.title] = filePathVO;
 }

I’ve tested accessing this from a view component.

// accessing from another class -----------------

var _background_image_path:String = String( filePathModel.locationHash['shell_background_image']);

it returns undefined.. any ideas?

  • 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-15T13:33:30+00:00Added an answer on May 15, 2026 at 1:33 pm

    You forgot the @ for location attribute on this line:

    var filePathVO:DataVO = new FilePathVO(file.@title.toString(),
         file.location.toString());
    

    The real problem lies on the line:

    var files:XMLList = xml.files.file;
    

    Change it to

    var files:XMLList = xml.file;
    

    The xml variable refers to the root tag of the xml; there is no need to access it explicitly with xml.files. xml.files.file actually looks for file tags that are direct children of files tags that are direct children of the root-xml tag. It would’ve worked had your xml been something like:

    <?xml version="1.0" encoding="utf-8" ?>
    <root>
      <files id ="xmlroot">
        <file title="css_shell" location = "css/shell.css"  />
        <file title="xml_shell" location = "xml/shell.xml"  />
        <file title="test" location=   "test/location/test.jpg" />
        <file title ="shell_background_image" location = "images/shell_images/background_image.jpg" />
      </files>
    </root>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with loading data into an < object > using Javascript.
I have the problem with loading properties from xml inside jUnit test (the same
I have problem while loading data into html select when users press or click
I'm new to ruby and I have a problem loading gems. I've read every
I have a problem with loading icons from external resource files in main application.
I have problem with loading images from the Documents folder of iPhone application into
I have problem with loading resources for UserControl from referenced assembly in Expression Blend
I have a problem when loading a text file with unicode content into a
I'm new to rails and testing and have a problem with loading my fixtures.
I have problem with lazy loading in many-to-many. There is no exception and there

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.