How can I read an XML string that's not from an XML file?

I've got a script I'm trying to setup that communicates over a socket to retrieve different directions from a custom built Java program.  The Java program listens to requests from the Adobe scripting engine (in my case it's a Photoshop script) on a socket and immediately responds with the next set of directions.  These directions are currently in XML format.  The issue I'm having is that I can't parse the XML data since it's entered into a new XML object from a string rather than being read from a file.  Even without the socket code, you can see the issue by doing the following:
var xml = new XML("<test><data>hey!</data></test>");
alert(xml.test.data);
alert(xml);
The first alert "should" return "hey!" (without quotes, of course), but it doesn't, while the second alert returns what you would expect it to:
<test>
    <data>hey!</data>
</test>
It works fine if read from an XML file, but from a string, like shown above, it just presents an empty alert box when attempting to access "xml.test.data".  Any ideas on how to fix this issue?  Can it be fixed?  Has it been fixed in newer versions (I'm currently using CS4)?
Thanks in advance for any help!

Duh... found my error... I was attempting to access the data by referencing the created "root" element.  Since <test> is the very first element tag, it's setup as the root element, which you don't need to reference.  Changing the alert to alert(xml.data); fixed it.
Now I just feel dumb, lol...

Similar Messages

  • How can I erase a photo album that was uploaded from an old computer that I don't have no more? I have other albums in the Iphone that I don't want to delete.

    How can I erase a photo album that was uploaded from an old computer that I don't have no more? I have other albums in the Iphone that I don't want to delete.

    If you sync with the new computer it will erase the current content from the iphone and replace with the selected content of the new computer.
    The pics that you have taken with the iphone should be imported regularly to your computer as you would with any digital camera.  You can then organize them and sync them back to the iphone if you wish.
    If you have had itunes perform a backup on the new computer, you should get the pics taken with the iphone back, but I would import them before trying anything.

  • How can I get rid of photos that were downloaded from my computer?

    How can I get rid of photos that were downloaded from my computer?  I need to free up space on my iPad

    Assuming that you synced the photos from iTunes - or whatever downloaded means - you must use iTunes again in order to remove the songs from the iPad. You have to uncheck the albums in the photos folder that you sync from in the Photos tab of iTunes and follow that with a sync.

  • HT4623 how can i update my iphone 4 that does not have the update option in the settings?

    How can i update my iphone 4 that does not have the update option in the settings?

    From the article you linked, scroll down to the section "Update your device using iTunes"

  • How can I get my pics back that were deleted from icloud?

    How can I get my pics back that were deleted from icloud?

    Read this:
    http://support.apple.com/kb/HT1414

  • My hard drive failed so I sent it off to get recovered. How can I get my music back that I purchased from my old iTunes account?

    My hard drive failed so I sent it off to get recovered. How can I get my music back that I purchased from my old iTunes account?

    See Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • I am trying to sync music from my iTunes library on my iMac to my iPhone. I only want selected music but I'm getting unwanted songs. How can I delete those songs on my iPhone or how can I prevent these unwanted songs that have not been selected from appea

    I am trying to sync music from my iTunes library on my iMac to my iPhone. I only want selected music but I'm getting unwanted songs. How can I delete those songs on my iPhone or how can I prevent these unwanted songs that have not been selected from appearing on my iPhone? Help!

    http://support.apple.com/kb/HT1296

  • How can I retrieve my calendar info that was sucked from my iPad 2 after upgrading to OS V and backing up to iCloud (using Windows XP computer with Outlook)?

    How can I retrieve my calendar info that was sucked from my iPad 2 after upgrading to OS V and backing up to iCloud (using Windows XP computer with Outlook)?

    I think (and I'll double check) only the BBLink events will sync on a wired USB sync. I'm fairly certain of that.
    You'll need to use your calendar syncing via an EAS email account (outlook.com, for instance, is free) to sync wirelessly. It works great. I use it and was a former tied to the USB sync guy as well... and I thought I was gonna die a painful death without it. I found more freedom this way.
    This explains the process. But I don't think you'll get BBM Groups to sync.
    http://supportforums.blackberry.com/t5/BlackBerry-​Z10/How-To-OTA-Sync-BB10-and-non-BES-Outlook-Overv​...
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • My hard drive crashed and I have lost my Itunes library. How can I get my the music that I loaded from my own CDs back on my PC from my iPod?

    My hard drived crashed in my HP Pavilion desktop and I have installed a new one. I have Windows 2007. My Itunes library is gone. How can I get all the music that I loaded onto my iPod from my own CD's back into an Itunes library?

    The loading of audio files to iPod is designed to go one way only: computer to iPod. There are some third-party applications available which will rescue an audio library and write the files back to a PC HDD. The playlists might not copy, nor the album art work, nor videos but you might be able to recover all audio files. Some apps are open source and available for free download, for example: Senuti, Onyx. There are others which are  Windows-based; do a Google search to find out. 

  • How can i remove videos and music that are not on my ipad mini but are still taking up space and are showing that they are there even after i've deleted them?

    how can i remove videos and music that have been deleted from the ipad but are still showing in settings as still being on the ipad?

    I believe that I have the same issue with iPad Mini with Retina Display, iOS 8.1. No matter which way I delete videos from my iPad, they will still show as "deleted", yet the space is not cleared up. I tried restore and then a full restore (clean setup as a new iPad) and it still does this to me. I can solve it by doing a restore each and every time I download a video and delete it. Rather frustrating. Has been a problem since day 1 of iOS 8. I'm yet to try the power+home button reset. It may very well work, but I am surprised that a "fresh setup" of an iPad didn't resolve it from ever occurring.

  • How can I process pics in Lightroom that  have uploaded from my IPad?

    How can I process pics in Lightroom that I have uploaded from my IPad? I have managed to copy pics from the IPad into a file located in My Lightroom Pictures (and located on an external Hard Drive), which is where I put all my pictures. I an see the file in Finder and can even work with them as a Project in IPhoto, but nothing happens in Lightroom.

    Hi johnhb2,
    To import photos from your iPad into your Windows computer, I would suggest that you use the steps in this article -
    iOS: Import personal photos and videos from iOS devices to your computer
    http://support.apple.com/kb/HT4083
    Note that by default the pictures are placed in the “My Pictures” folder. Once imported you can see your photos there and use whatever application you want to view or manage them.
    Thanks for using Apple Support Communities.
    Best,
    Brett L

  • How can I find out  the strings that will be presented to the UI

    Hi All,
    I am working on a Swing based application (Swing based UI)
    I am requested to do the following on the bytecode of that application:
    I am supposed to find out what strings from within that bytecode will be presented to the UI and what will be used for an internal usage.
    i have no way of running the application to verify that, i can only work on the static bytecode files.
    hard question ha?
    Thanks,
    EItan.

    You would of course have to run it. Either via a VM or recreating a VM yourself.
    As an example of that how would you figure out what string occurs in the following (pseudo) code?
    String msg = (cnt > 1) ? ("files=" + cnt) : ("file=" + cnt);
    if (cnt > 1) DisplayMessage(msg);

  • How can I purchase an iPhone app that is not available in the AppStore I'm registered in but is available in another country's AppStore?

    Hello, guys. My problem is that I want to purchase an iPhone app that is not available in my AppStore(s). I am registered in the Japanese and Russian AppStores, and the app I want is available only in the American AppStore. Do I have to change my AppStore for this? And how can I do it? Or do I have to create a new Apple ID for the American AppStore? I tried to do the latter, but it requires a billing address located in the US, which I don't have. What are my options?
    Thank you in advance.

    No worries. The forums can be a bit confusing to navigate at first.
    You might want to contact the developer of the app in which your interested and suggest they offer it in your country. There may be reasons they can't but if they can and they know there's interest, they just might.
    Best of luck.

  • How can I open a web page that is not compatible with safari?

    Hi all
    I get the following message when I try to go to a certain web site:
    http://www.sia.homeoffice.gov.uk/Pages/licensing-rolh.aspx click on the "GO TO THE REGISTER" button
    Please note: clicking the button above will transfer you to our secure server, which will open in a new window. You must be using Internet Explorer 6, 7 or 8, or Netscape 7.02 for the new site to display properly. You can return to this site by closing the new window.
    I have looked at Internet Explorer and Netscape and both seem to be out of date with our IOS.
    How can I access this page?

    Try downloading another browser, Firefox for example. Open the link in Firefox and once the page opens copy the link and paste it in safari address bar. That works for me.
    Still trying to find out why we have to do this though since it works just fine in Safari once you had it opened in another browser.
    Hope that helps you!

  • How can I remove a mail account that does not show up in Internet Accounts?

    I have a Mail account that I cannot remove because it does not show up in System Preferences > Internet Accounts.  How can I remove this account permanently?
    Here is the account in Mail:
    Here is what I get when I try to remove it:
    Here is what shows up when I click on Internet Accounts:

    Thanks, it was linked in iPhoto.  After removing it from iPhoto I still got the same message when trying to delete the account from Mail.  After rebooting, I was able to remove the account from Mail.

Maybe you are looking for

  • Calling stored procedure using jdbc

    Hi all, I'm new to jdbc calling pl/sql and I have a very simple question. I'd like to execute this before I read data from the table: BEGIN packageA.functionA(1234567890123456); END; My jdbc code: try { DriverManager.registerDriver (new oracle.jdbc.d

  • Cloning my IMac to MacBook Pro

    I am going to buy a macbook pro very soon. I would like to know is it posable to clone my intel Imac to a macbook pro so they both are alike. or is it better to sync them some how.

  • HT4461 Can I use my App Gift Card to purchase I-tunegift cards

    Can I use my App Gift card to purchase Itune Gift Card?

  • Power PC apps crash on startup in OS 10.5.8 Leopard

    Hi all. I've been reading a great deal in this forum regarding the issue in the subject line of this post.  But it all has to do with 10.6.8 Snow Leopard.  My 10.5.8 on my system has not been updated in any way for a while.  So how is it that in the

  • ClassCastException on SAX parser factory newInstance

    When trying to instantiate a parser factory, if none of the weblogic classes have been accessed, the instantiation goes well. If a weblogic class has been accessed, then I get the following stacktrace: java.lang.ClassCastException: weblogic.xml.jaxp.