E4X: What happens to the root element?

I'm working with XML using the E4X notation. I'm used to the "old school" XML APIs that use DOM and I'm a bit confused.
For example, let's consider the following XML
<mx:XML id="myXML" >
  <top>
    <sub1 id="uno">
      <sub2>hello</sub2>
      <sub3>world</sub3>
    </sub1>
    <sub1 id="duo">
      <sub2>ok</sub2>
      <sub3>ko</sub3>
    </sub1>
  </top>
</mx:XML>
In my code I use the following traces. This is done with the De MonsterDebugger, but all others should work the same way. I have casted the traces to String only to make it easier to ask this question (no need post images)
MonsterDebugger.trace(this, "myXML:" + myXML);
MonsterDebugger.trace(this, "myXML.sub1: " + myXML.sub1);
MonsterDebugger.trace(this, "myXML.sub1.sub2: " + myXML.sub1.sub2);
What I get as output is
(String) = myXML:<top>
  <sub1 id="uno">
    <sub2>hello</sub2>
    <sub3>world</sub3>
  </sub1>
  <sub1 id="duo">
    <sub2>ok</sub2>
    <sub3>ko</sub3>
  </sub1>
</top>
(String) = myXML.sub1: <sub1 id="uno">
  <sub2>hello</sub2>
  <sub3>world</sub3>
</sub1>
<sub1 id="duo">
  <sub2>ok</sub2>
  <sub3>ko</sub3>
</sub1>
(String) = myXML.sub1.sub2: <sub2>hello</sub2>
<sub2>ok</sub2>
All is fine above and this was a bit long abstract for my question. The question is what happens to the root element, in this case <top>? I was trying to access the data with the following notation
myXML.top.sub1; // etc
I spent quite a lot of time trying to get it to work, until I discovered that the root element is not used. Can anyone explain this?
Or, I guess the simple explanation is that the root node is ignored and the sub nodes are created as properties of the object. The question also could be stated as: Why isn't this documented in the Flex API Reference?
Thanks.
P.S. I found this article on common E4X pitfalls which also has other interesting topics when working with E4X.

its gone
downgrading would kill the phone..

Similar Messages

  • What happened to the font "Betsy" in elements 7, after updating it's gone.

    what happened to the font "Betsy" in elements 7, after updating it's gone

    Reset you preferences:
    1. Close Elements.
    2. Launch the Photoshop Elements Welcome Screen and hold down ctrl + alt + shift as you click Editor.
    3. Continue to hold the keys until you see a message box asking if you want to delete Photoshop Elements settings file; click Yes. Elements will open with default preferences.

  • What happens to the original photo after editing?  Does it get replaced by the edited photo?

    I just bought my first iPhone(5).  On Android, when editing a photo, the original stays in your gallery and the edited photo gets placed right next to it.  So what I want to know is, When editing a photo in the photo app, what happens to the original since it would be nice to be able to make different edits of it.

    That is an excellent question. This is definitely not the programmed behavior of Photoshop Elements. Normally, when you edit a file, a new copy of the file is created (the original is simply left alone). This new copy of the file will have "_edited-1" added to the end of the name. It should definitely not be adding $ to the name at all.
    Just as a test, create a new user account on your computer, and try editing another image to see if does the same thing there. However, I suspect there is another application on your computer that is modifying how files are saved, deleted, and renamed.

  • HT4796 what happens to the transferred files when the migration aborts?

    My migration aborted after an hour because the windows computer went to sleep.  What happened to the files that already transferred?  Where are they stored during the transfer?  The mac is mtn lion.

    Look in /var/folders
    In my case /var/folders/zz/blahblahlbah/T/.XMSandbox-tmp/Users/userid/Root
    rebooting got rid of them

  • Start of the root element expected.

    Hello Gurus,
    I moved all my project contents from one root directory to another, after seting up everything. It gives compile time error on adf-faces-config.xml and adf-faces-skins.xml.
    The error:
    XML-20108 - Start of the root element expected.
    I have no idea what could have originated this error and how to fix it. Can any one help me?
    Thank you.
    Ruchir

    I built the new project structure from scratch. i.e. created new application, then added a web project, then added all css file from old locations, then, created new xml documents and renamed it to adf-config-faces.xml and adf-faces-skins.xml and manually copied from these config xml documents from old location to newer one.
    And then at last, copied the .jspx page and when compiling that, control moves to adf-config-faces.xml file and gives the error.
    Thanks,
    Ruchir

  • The markup in the document preceding the root element must be well-formed

    Hi,
    Each time I add some library, something serious happens to my NetBeans5.5 and Tomcat 5.5.17. This time I added jsf-facelets.jar and now nothing is being deployed. I m getting following exception
    javax.servlet.ServletException: Error Parsing /Dept.jsp: Error Traced[line: 1] The markup in the document preceding the root element must be well-formed.
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:202)
    Is there any special procedure to follow to add libraries?
    Plz help.

    Facelets is XHTML. XHTML is XML-HTML. XML require strict well-formness of the tags. I.e. every tag should be correctly nested and closed.
    I would say, read the Facelets Developer Documentation: http://www.google.com/search?q=facelets+developer+documentation

  • Just updated iMovie today. What happened to the Ripple transition?

    Just updated iMovie today. What happened to the Ripple transitions?

    I had the same problem.  After about and hour with Apple care and several different people, I was told Apple eliminated the Ripple transition as part of the 9.0.6 update.  It's gone...no way to get it back in 9.0.6.  I was just finishing a project that used a bunch of this transition, so I found a work around.  I used Time Machine to revert back to the old version of iMovie (9.0.4).  When asked if I wanted to replace or keep both files, I elected to keep both files.  I now have a version of iMovie called iMovie (Original).  That still has the Ripple effect.  Seems to be working fine also.  I can't image why Apple did this.  I left feedback in the feedback forum.  Recommend we all do it so they will place the Ripple back.  This is the first time I've really used iMovie for a big project.  I've discovered I'm probably better off with something like Final Cut or Adobe Elements.  That's what I know.  Hope it helps.

  • What happened to the whoosh sound on my outgoing mail?

    What happened to the whoosh sound onmy outgoing mail?

    Dear Scotch27:
    i am so sorry it did not work for you!  I know, it is really really frustrating, as i have been having this problem for many months!  I have not gotten Mountain Lion yet...maybe i won't!  LOL!
    btw, i got this reply from another poster, on a similar forum, so i copied it here to see if it would work for you...it didn't for me, but it did, for many other posters:
    Go to applications/utilities and run Audio Midi Setup.  Click the Builtin output link in the left pane click the down arrow next to the right-mast element after "Format" and change to something else, then back to what you originally had there.  All pent-up sounds will come rushing through your speakers and you'll be OK with Mail sounds until it happens again.  This worked for me in OS X 10.7 Lion; the problem seems to have been fixed in OS X 10.8 Mountain Lion.  Good luck!
    this post was from Chazcone, in a discussion question: "Re: "New Message" sound not playing in mail 5"....i really hope it works for you!  i think it is ridiculous, that this is obviously a KNOWN bug somewhere within apple mail (icloud?), but no one has seriously looked into it, and/or fixed it, most especially in the new ML!!!  let me know what happens, and i will pass along anything else i find to you re: this issue....good luck, and so sorry my "solution" didn't work for you!
    joyce(joyceji)

  • What happens to the open item in bsid table when it is cleared

    hi experts,
                   i have a doubt about open and cleared items of accounting documents. as we know open items of customers are stored in bsid and cleared ones in bsad. For suupose, an open item is closed ina particular period then what happened to the entry in bsid and bsad table. an entry regarding is stored in bsad (cleared),and what happens to the entry in bsid, still it will be there or removed from it.

    Hi,
    When ever we clear the document(Complete payment) that document will be moved to BSAD table. Other wise it will remain in BSID.
    If u are making partial payment then all the partial payment documents along with original document will be stored in BSID till u made the complete payment for that invoice.
    Assumption is u have to give all partial payment documents made for particular invoice item while u are making complete payment in F-28 transaction. So that these partail payment documents will also be cleared while making complete payment and moved to BSAD table.
    This trasaction can be used for both partial and complete payments.
    Irrespective of complete or partial payments made all the documents will remain stored in BKPF and BSEG tables.
    BSID and BSAD are index tables to address performance issues with BKPF and BSEG tables.
    So all open and cleared documents will be there in BKPF and BSEG tables.
    All cleared documents will be there in BSAD table.
    Alll open documents will be there in BSID table.
    Hope it is clear.
    Thanks,
    Vinod.

  • What happens to the mail in my iMac after I delete it from my iPhone? Will it be deleted from my computer as well?

    What happens to the mail in my iMac after I delete it from my iPhone? Will it be deleted from my computer as well?

    If they are both using the same iCloud ID (assuming you are running your mail from iCloud), then yes, the email will disappear from your Mac after you delete it from your phone and after your phone sycs with iCloud and your Mac syncs with iCloud.
    I use a windows phone, but it works the same.

  • Just upgraded to 5 from 3 - what happened to the page select icon? Can't find it in customize toolbars.

    Used to be you could select which page you wished to go back or forward to from the arrow icons on the navigation toolbar. The history menu item only shows 10 sites without having to open history for today. What happened? Is there another icon or a new plug in for this functionality? I used it all the time.

    ''what happened to the page select icon (Back/Forward)''
    The back/forward buttons have been moved to right-hand side of the navigation bar and the drop-down was removed. User right-click or hold click for one second to see the tab history. This is item #5 in my list.
    The History menu also has "Open Previous session" and "Open closed windows",
    to see more history use the History sidebar ("Ctrl+H") or the History Library List ("Ctrl+Shift+H") and sort or view by "Last visited".
    You can make '''Firefox 5.0.1''' look like Firefox 3.6.19, see numbered items 1-10 in the following topic [http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface Fix Firefox 4.0 toolbar user interface, problems (Make Firefox 5.0.1, or 4.0.1, look like 3.6.*)]. ''Whether or not you make changes, you should be aware of what has changed and what you have to do to use changed or missing features.''
    * http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface

  • What happens to the while loop iteration counter if it runs unchecked?

    I want to use the iteration counter to initialise a value on the first loop of a while statement. ie i = 0, x = 100. Fine. The application I am building will be left to run for weeks or months on end without stopping (hopefully :¬)). What happens to the iteration counter in this situation? Does it reset to 0 or what? I don't want it reinitialising any values while the loop is running other than when it starts.
    I set up a while loop to try to figure out what happens and the iteration counter stops at 2147483648 which is 2^31 - 1.
    Any help would be appreciated,
    Thanks,
    Niel.

    It might be something you already looked at, but perhaps it's an option to perform the initialization outside (before) the while loop. That way it will be initialized correctly only once, no matter what the iteration counter does.
    Of course if you need the counter for other purposes than initialization you might have the same problem...
    Note that a lot of the timer functions also overflow after a certain time (I believe 24 or 48 days?) so be careful running very long loops (but you already knew that probably).

  • TS2972 I just updated all of our computers to itunes 11 and now when we try to use our home sharing, we can't import songs.  What happened to the easily located "import song" feature?  I wish now that I wouldn't have updated to the new itunes 11.

    I recently updated all of the computers in the house to itunes 11.  Now when we try to import songs from homesharing, we are unable to.  What happened to the conveniently located "import song" button on the old version of itunes.  Please help an old mother out please!

    diesel vdub, i use 11.1.1
    solved the issue today. first sync with itunes, so all the stiff you bought on the mobile will be backuped.
    1. uncheck sync music in itunes and sync. all the music will be erased from mobile device
    2. check music player on the mobile device. just the unwanted songs will still be there
    3. go on the iphone to settings, general, usage, music player. there is just a few mb from the remaining unwanted songs. swipeleft and erase the content. switch iphone off and on again
    4. repeat step 2. there will be no data. otherwise repeat step 3
    5. check sync music in itunes and sync. all the music will be back again but not the unwanted songs.

  • How can i change the ROOT ELEMENT name in my ADOBE Form

    Hello All,
    I need to change "data" the Root Element default name to another name.
    Is this possible? How do i do this?
    Thank you all in advance,
    Eran

    Hello Chintan and Otto,
    thank you for your replies...
    Chintan: There is Adobe livecycle designer CE and its a stand alone application :[ designer CE2|http://www.adobe.com/products/livecycle/]
    Otto: I know i can send the xml back and change it in my abap program but i'm talking about stand alone form in a computer with no sap on it.
    The user will fill it and submit it ...
    Thank you all in advance,
    Eran

  • What happened to the "closed tabs" list in 4.0 RC2?

    What happened to the "closed tabs" list in 4.0 RC2?
    In prior versions of Firefox, I could open a list of closed tabs, but I can't find the button now.

    Hi g,
    Many features have been lost in Numbers 3. You can send feedback to Apple with Menu > Numbers > Provide Numbers Feedback.
    And... playing the Devil's Advocate, have a look here:
    Features that Apple has promised to reinstate:
    http://support.apple.com/kb/HT6049
    Hints on workarounds here:
    https://discussions.apple.com/message/23622372#23622372
    What has been GAINED in Numbers 3 is here:
    https://discussions.apple.com/thread/5473882?start=75&tstart=0
    What has been lost in Numbers 3 is here (with corrections where Apple has already reinstated some lost features in the Numbers 3.0.1 update):
    https://discussions.apple.com/thread/5470448?start=240&tstart=0
    I enjoy running both versions of Numbers (Numbers 2 and Numbers 3) at the same time. They each have strengths and weaknesses.
    Numbers 3 did not replace your Numbers 2 (Numbers '09). Look in a folder called iWork '09 inside your Applications folder. And enjoy.
    Regards,
    Ian.

Maybe you are looking for