A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] XML Filtering - XMLList empty when only one match?

  1. #1
    Member
    Join Date
    May 2004
    Posts
    57

    resolved [RESOLVED] XML Filtering - XMLList empty when only one match?

    Hi there,

    I have a problem with XML filtering.

    Actionscript Code:
    xmlList=_linksXML.link.(@name=="download");
    trace(xmlList);

    If there is only one result, trace is empty. If there are 2 results or more, they will be traced fine. Is it because one result is not an XML 'list'? If so, how do I get the results if there is only one match?

    Thanks in advance.
    He took daddy's umbrella!

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    The trace could be empty because the content of the node is empty. Trace calls toString, which for XML with simple content will return only that simple content. If that content happens to be empty, it returns an empty string. You might try tracing xmlList.toXmlString() instead.

  3. #3
    Member
    Join Date
    May 2004
    Posts
    57
    Doh! Yep, you're spot on in your first sentence. I didn't realise it would work like that i.e. trace(xmlList.url) for single results. I thought I'd have to trace(xmlList[0].url). Thank you!
    He took daddy's umbrella!

Tags for this Thread

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