dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: I don't understand XML as practical..

  1. #1
    Join Date
    Sep 2007
    Posts
    2

    Question I don't understand XML as practical..

    I do not fully understand XML, I've tried reading articles- and I get HOW xml is tree-structured, useful for databases, etc and what not. I don't get what to do with it though.. can someone please offer some insight, in example form, of how it would be implemented and how it would be used?

    I believe I'm just missing the connection here, thanks in advance.

  2. #2
    Join Date
    Apr 2007
    Posts
    153
    It is a useful way to transfer data.

    I use it to retrieve data from my server via http requests (ajax).
    Instead of having the php make a text file of data I need from a database, I have it create an XML document that is easy to parse via .getElementsByTagName() and the tagname being whatever I decided it to be in the XML file, usually the same name as the javascript variable I am going to put that data into.

    I found it much easier to do that than to try to custom parse a text file generated by php.

    I also know that at least one multiplayer game lets squads have custom textures and info in-game using XML as the delivery vehicle for that information.

  3. #3
    Join Date
    Sep 2007
    Posts
    2
    That makes more sense to me, as I deal with a similar scenario; hadn't thought of it that way. Ajax has been something I am looking into, thus I've been taking a crash course in XML. Thanks!

  4. #4
    Join Date
    Apr 2007
    Posts
    153
    One thing I recently learned about using http requests is that by default Firefox will not allow synchronous http requests.

    Being brand new at it myself, I thought I needed synchronous requests because I needed to wait for a successful response from the server before I could populate my js variables with the data, but found that it did not work in Firefox unless I had the Firebug plug-in installed, then for some reason synchronous requests did work.

    I did however change my method of populating my js variables and only use asynchronous http requests, and using small animated gifs for blinking lights that start blinking when a request has been made, and stop blinking when the response has been received and handled, made it a little nicer for the user.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles