dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] Target attribute of xml node?

  1. #1
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546

    resolved [RESOLVED] Target attribute of xml node?

    I've used a lot of XML in Flash, but this one really bugs me and I can't find how to make it work!

    I have a simple XML like this one:
    Code:
    <root>
            <project>
                    <descr>some text</descr>
                    <items>
                            <item attr="text" />
                   </items>
            </project>
    </root>
    I can target the items (there are more in my complete xml) with:
    project.items.children()
    But I can't seem to get to the attributes

    Anyone good at this?
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

  2. #2
    a.k.a gltovar deadlock32's Avatar
    Join Date
    May 2001
    Location
    Naperville,IL
    Posts
    489
    you use the '@' symbol

    so it would be something like:

    root.project.descr.items.item.@attr

  3. #3
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546
    Thanks, but I already knew that I had to use the @ symbol. My apologies for not making that clear

    But I remembered by looking at your line of code that calling the items.item would create a new xml with all of the item tags inside of it.
    And then is just the good ol' square brackets ^^
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center