daily pastebin goal
7%
SHARE
TWEET

Untitled

a guest Oct 20th, 2018 120 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. readFile = (root) ->
  2.     dataset = root.find('dataset')
  3.     info = dataset.find('metaInformation/processInformation')
  4.     reference = info.find('referenceFunction').attrib
  5.  
  6.     process =
  7.         id          : root.find('dataset').attrib.number
  8.         name        : reference.name
  9.         category    : reference.category
  10.         unit        : reference.unit
  11.         geography   : info.find('geography').attrib.location
  12.         description : reference.generalComment
  13.         edges       : []
  14.  
  15.     for exchange in dataset.findall('flowData/exchange')
  16.         exchange = exchange.attrib
  17.         process.edges.push
  18.             id          : exchange.number
  19.             name        : exchange.name
  20.             category    : exchange.category
  21.             subCategory : exchange.subCategory
  22.             unit        : exchange.unit
  23.             geography   : exchange.location
  24.             description : exchange.generalComment
  25.  
  26.     return process
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top