Skip navigation
Currently Being Moderated

Can't access xml tags directly:: Namespace issue

Sep 18, 2012 12:50 PM

Tags: #tags #3.0 #xml #actionscript #access #direct

It appears that I've found another case of "Flash does (this) great. EXCEPT . . . . . "

 

I've posted my issue on a couple forums with no replies. Rather than repost I'll just put the link here and hope SOMEBODY has an answer.

 

http://www.actionscript.org/forums/showthread.php3?p=1137057#post11370 57



 
Replies
  • kglad
    62,147 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 18, 2012 12:50 PM   in reply to lheinem99

    you need to use that namespace to reference xml elements.  try:

     

    var s:Namespace=xml.namespace();

    trace(xml.s::responseDeclaration);

     
    |
    Mark as:
  • kglad
    62,147 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 18, 2012 12:04 PM   in reply to lheinem99

    what are your publish settings?

     
    |
    Mark as:
  • kglad
    62,147 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 18, 2012 12:47 PM   in reply to lheinem99

    oops, you're correct.

     

    i fixed that in message 1 so, you can mark that as correct if you found it helpful.

     

    there are 2 ways a namespace can be used in xml.  the way you are using it, the namespace applies to each and every node within the xml.

     

    to reference each of every node (but not attribute) you must use the namespace string:

     

    trace(xml.s::responseDeclaration.s::mapping.s::mapEntry.@mapKey);

    trace(xml.s::responseDeclaration.s::mapping.s::mapEntry.(@mapKey=="A") .@mappedValue);

     
    |
    Mark as:
  • kglad
    62,147 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 18, 2012 1:32 PM   in reply to lheinem99

    you're welcome.

     
    |
    Mark as:
  • kglad
    62,147 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 19, 2012 6:40 AM   in reply to lheinem99

    i'm not sure what you're asking.  but if you are asking for a short cut to traverse your xml, you can use the double dot:

     

    trace(xml..s::simpleChoice);

     
    |
    Mark as:
  • kglad
    62,147 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 19, 2012 1:26 PM   in reply to lheinem99

    use array notation:

     

    var itemS:String="simpleChoice";

     

    .

    .

    .

    var simpleChoiceList:XMLList = xml..s::[itemS];

     
    |
    Mark as:
  • kglad
    62,147 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 19, 2012 2:10 PM   in reply to lheinem99

    you're welcome!

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points