User Tag List

Results 1 to 6 of 6

Thread: Read XML with GET Object

  1. #1
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleUnicode Add-onInstall Creator Pro
    StingRay's Avatar
    Join Date
    Nov 2006
    Location
    Austria
    Posts
    1,057
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    Question Read XML with GET Object

    Hi!

    is there a way to read a xml-file with the get object? the main problem is, i think,
    that in a xml file every unit is called the same. example:

    http://www.google.de/ig/api?weather=New%20York&hl=us

    you'll get an xml file with forecast conditions for different days. but every high temperature data
    for every day is called:

    <high data="28"/>

    how can i figure out, if it is for the first day or the third? it makes parsing really hard, i think.

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleXNA Export Module
    DistantJ's Avatar
    Join Date
    Jan 2008
    Location
    Gloucester, UK
    Posts
    2,144
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Hmm...

    <forecast_conditions>
    <day_of_week data="Di."/>
    <low data="21"/>
    <high data="28"/>
    <icon data="/ig/images/weather/mostly_sunny.gif"/>
    <condition data="Meist sonnig"/>
    </forecast_conditions>

    So that's a day...

    I'd use string parser, set </forecast_conditions> as the delimiter, then each day will come out as a different element you can grab from the 'List Tokenizing' menu from the parser's expressions menu. You could then grab the two characters that follow 'high data ="' using the 'find string in string' and 'extract middle substring' functions.

  3. #3
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleUnicode Add-onInstall Creator Pro
    StingRay's Avatar
    Join Date
    Nov 2006
    Location
    Austria
    Posts
    1,057
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    great idea - and so easy thank you!!

    i hope it works now, because i run into some xcode sigbrt error with the use of string parser some months ago.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleXNA Export Module
    DistantJ's Avatar
    Join Date
    Jan 2008
    Location
    Gloucester, UK
    Posts
    2,144
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Glad you found it easy! I was worried I hadn't explained it clear enough. Delimiters are the only way I can think of splitting them at the moment, not without some kind of insane character-by-character fastloop anyway, lol.

  5. #5
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleUnicode Add-onInstall Creator Pro
    StingRay's Avatar
    Join Date
    Nov 2006
    Location
    Austria
    Posts
    1,057
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    ok - very strange happend:

    - on windows it works like a charm.
    - on ios simulator it shows received text: "unsupported api"
    - on ios device (iphone4) it crashes. exit code 0. sigbrt error. (EDIT: This just happens because i've forgot to add 'run this event once' at 'on get complete') --> It now shows "unsupported API" too.

    i dont use stringparser at the moment, just 3 GET objects with some events:

    Mid$(Received$( "Get object weather" ), Find(Received$( "Get object weather" ), "<condition data=", 1)+17, Find(Received$( "Get object weather" ), "/><temp_f", 1)-Find(Received$( "Get object weather" ), "<condition data=", 1)-18)

    to get the actual temperature. hmm. too bad. is this one part of the fight GOOGLE vs. APPLE?!?

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleXNA Export Module
    DistantJ's Avatar
    Join Date
    Jan 2008
    Location
    Gloucester, UK
    Posts
    2,144
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Course not, they must have some kind of htaccess blocking mobile devices from reading the xml or something.

Similar Threads

  1. Regitry2 object to read the value of a saved regitry entry.
    By edkeyte in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 7th March 2013, 10:04 AM
  2. READ STATE KEY (Android Object)
    By Koji_Kabuto in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 12th September 2012, 10:38 PM
  3. How to use the XML object to read the IIS 7 metabase?
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 21st May 2012, 02:46 PM
  4. Yves read please - High Score Object.
    By Keli in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 26th January 2010, 08:11 PM
  5. What would I use to shoot an object(read for det.)
    By csj1 in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 29th July 2008, 04:17 PM

Posting Permissions

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