Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 09-05-2011, 04:23 PM   #1
Andrew.Stubbs
Registered User
 
Join Date: Sep 2011
Posts: 1
Default Issues with XML

Apologies if I'm being completely stupid, which is the only conclusion I can come to but I'm having real trouble getting the XML traversal functions to return the values I expect, for example with the following xml:

var x:XML =
<a>
<b>
<c>
<d/>
<e/>
</c>
</b>
<f />
</a>

I would expect `trace("F: " + x..f);` to print "</f>, instead I get nothing.
Similarly, if I attempt to print each element with:
trace("A: " + x..a);
trace("B: " + x..b);
trace("C: " + x..c);
trace("D: " + x..d);
trace("E: " + x..e);
trace("F: " + x..f);
I would expect, from my understanding of the documentation, that each would print every occurrence of the named element, and its sub-elements, however I get:
A:
B: <b>
<c>
<d/>
<e/>
</c>
</b>
C: <c>
<d/>
<e/>
</c>
D:
E:
F:

i.e. B and C print what I expect, but I can't understand the reasons for the others failing.

Any clarification on my wrongdoings would be appreciated.

Last edited by Andrew.Stubbs; 09-06-2011 at 07:48 AM. Reason: Misnamed variable
Andrew.Stubbs is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:18 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.