Visualising .XML files

Thomas Shorey's Avatar

Thomas Shorey

02 Apr, 2014 03:49 PM

Is there anyway of visualising a .xml file retrieved via the Get HTTP node?

The HTTP address is:
http://cloud.tfl.gov.uk/trackernet/predictiondetailed/v/OXC

  1. Support Staff 1 Posted by Frederik De Ble... on 03 Apr, 2014 09:01 AM

    Frederik De Bleser's Avatar

    The issue is how to "flatten" the XML file so it appears as a table.

    Since your XML file is rather flat, we might get away with some shortcuts.

    I've included a project with a custom node that allows you to select the "path" of tags through the XML document. This is expressed as a list of tags separated by slashes, e.g. "A/B/C".

    Unfortunately, in your case, both the inbound and outbound parts of the document use the same "P" tag. I don't have a solution for that currently.

  2. 2 Posted by Thomas Shorey on 03 Apr, 2014 10:30 AM

    Thomas Shorey's Avatar

    That's great! Thank you so much. Yeah it's a bit annoying that in some feeds northbound is the first "P" and some southbound is.

    Would there be a way for the custom node to carry on looking for

    after it's found one set.

  3. 3 Posted by Thomas Shorey on 03 Apr, 2014 10:55 AM

    Thomas Shorey's Avatar

    Also... with regards to this and also the TimeToValue node you created for me, it's seems to crash when there's a value of "-" (it used to be 0:00, but it seems TfL have changed it to "-")

  4. Support Staff 4 Posted by Frederik De Ble... on 03 Apr, 2014 11:09 AM

    Frederik De Bleser's Avatar

    For the date conversion I've written another node that will make it into NodeBox itself soon. For now, I've attached it here.

    I takes an input format and an output format, both in a format you specify. The format uses Java's SimpleDateFormat -- see that page for examples.

    As for the next "P", the search algorithm needs to be expanded so that we can specify more complex queries. The "correct" way to do this is using XPath but I currently don't have time to implement that.

  5. 5 Posted by Thomas Shorey on 03 Apr, 2014 11:11 AM

    Thomas Shorey's Avatar

    Cheers, I think I've got enough to create enough visual elements to convey my idea.

  6. Frederik De Bleser closed this discussion on 03 Apr, 2014 11:13 AM.

  7. Thomas Shorey re-opened this discussion on 03 Apr, 2014 11:31 AM

  8. 6 Posted by Thomas Shorey on 03 Apr, 2014 11:31 AM

    Thomas Shorey's Avatar

    The new node still seems to be struggling when there data in the list which doesn't conform to the right format

    at some points I have a list as such

    1:00
    2:30
    4:00
    6:30

    How could I get rid of the dash? or make it equal to 0:00.

    I've just tried to write some python to do this...

    if x == "-"
    print "0:00"
    else print "x"

    don't think this is right though.

  9. 7 Posted by Thomas Shorey on 03 Apr, 2014 11:42 AM

    Thomas Shorey's Avatar

    for some reason it isn't showing the dash at the beginning of that list

  10. Support Staff 8 Posted by Frederik De Ble... on 03 Apr, 2014 07:58 PM

    Frederik De Bleser's Avatar

    You could use the string replace node to replace the dash with 0:00.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

25 May, 2024 11:52 AM
24 May, 2024 07:39 AM
16 May, 2024 02:11 AM
16 May, 2024 01:58 AM
14 May, 2024 01:29 AM

 

13 May, 2024 12:36 AM
12 May, 2024 07:46 PM
05 May, 2024 04:38 PM
03 May, 2024 06:50 AM
03 May, 2024 12:30 AM
03 May, 2024 12:09 AM