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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:09:20+00:00 2026-06-05T06:09:20+00:00

I have this XML problem that is bugging me today, and I can’t find

  • 0

I have this XML problem that is bugging me today, and I can’t find a solution because I don’t know how to phrase it.
My XML file looks like this:

<TEST>
  <ITEM_ID>0123
    <ITEM_SIZE>Medium</ITEM_SIZE>
    <ITEM_COLOR>Red</ITEM_COLOR>
  </ITEM_ID>
</TEST>

Everything works fine (i can find a random element, display or erase it) and can get the information I want, but the only thing that I cannot access the with myXML_XML.ITEM_ID[0], which shoud say “0123”. I get nothing, no error, nothing. When I check myXML_XML.ITEM_ID[0].ITEM_SIZE (when put in a String Var, I get “Medium” ).

I thought perhaps the XML was misleading so I tried with another file:

<TEST>
      <ITEM_ID REF="0123">
        <ITEM_SIZE>Medium</ITEM_SIZE>
        <ITEM_COLOR>Red</ITEM_COLOR>
      </ITEM_ID>
    </TEST>

Which gave me the same results, when checking for myXML_XML.ITEM_ID[0].REF or myXML_XML.ITEM_ID[0].REF.text

Anyone kind enough to enlighten me?

  • 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-06-05T06:09:21+00:00Added an answer on June 5, 2026 at 6:09 am

    Your first XML schema seems to be a little off, but valid nonetheless. You might want to try children() method of the nodes.

    myXML_XML.ITEM_ID[0].children()[0] // This is the text node

    In the other example, which is more readable in fact, you should use @ sign for accessing attributes

    myXML_XML.ITEM_ID[0].@REF

    Here is a complete example:

    var test:XML = new XML(
        <foo>
            <bar id="4444">
                efghi
                <baz>1234</baz>
                <quux>6789</quux>
            </bar>
            <bar id="4445">
                zxcv
                <baz>4567</baz>
                <quux>9876</quux>
            </bar>
        </foo>
    );
    
    trace(test.bar[0].children()[0]); // efghi
    trace(test.bar[1].@id); // 4445
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple problem with XML got from database. Now, this XML can
i have this problem to find a particular xml node l have post this
I have this problem that I cannot fix. From my @Controller , i can
I make a layout with this layout XML: and i have a problem that
I have this strange problem parsing XML document in PHP loaded via cURL. I
I have this problem, see the trace stack: E/AndroidRuntime(2410): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML
i have a small problem i have xome xml with a cdata section. This
Has anyone had this problem? My projects tend to have some long XML files
I have this device that sends XML data to a webserver in format as
I have this PHP code that adds a set of nodes to an XML

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.