Converting NRE Feed XML to JSON in Java

65 views
Skip to first unread message

George Roberts

unread,
Apr 14, 2016, 8:04:26 AM4/14/16
to A gathering place for the Open Rail Data community
I was wondering if this is possible for a fairly novice programmer to do. Reading around the site, it seems like this is not a simple task at all. Is there a very basic method to convert the xml or is it simpler for me to try to store the xml data as it is for querying. I'm trying to convert the data to store it for use in a train delay info website, if this information makes any difference. 
Thanks,
George 

petermount

unread,
Apr 14, 2016, 9:44:16 AM4/14/16
to A gathering place for the Open Rail Data community
The easiest way is to write an xslt stylesheet that accepts the xml and generates json. The problem is that there's a lot in the xml that may end up not being easily representable in json.

TBH when sending large volumes of data to the database (like these feeds) I tend to convert from json to xml before sending to the db as most database servers can handle xml (not many can handle json).
Reply all
Reply to author
Forward
Message has been deleted
0 new messages