Move From XML To CSV

Recently, we were discussing our file structure and realised that XML files are unnecessarily complex - we were using the following structure:
<livehousewaterusage>
 <appliance>
  <appname>sink</appname>
  <room>kitchen</room>
  <rate>55</rate>
 </appliance>
 <appliance>
  <appname>sink</appname>
  <room>bathroom</room>
  <rate>75</rate>
 </appliance>
 <appliance>
  <appname>toilet</appname>
  <room>bathroom</room>
  <rate>85</rate>
 </appliance>
 <appliance>
  <appname>bath</appname>
  <room>bathroom</room>
  <rate>80</rate>
 </appliance>
 <appliance>
  <appname>shower</appname>
  <room>bathroom</room>
  <rate>100</rate>
 </appliance>
 <appliance>
  <appname>shower</appname>
  <room>bathroom</room>
  <rate>100</rate>
 </appliance>
 <appliance>
  <appname>washingmachine</appname>
  <room>other</room>
  <rate>500</rate>
 </appliance>
 <appliance>
  <appname>dishwasher</appname>
  <room>other</room>
  <rate>759</rate>
 </appliance>
 <appliance>
  <appname>hose</appname>
  <room>other</room>
  <rate>10</rate>
 </appliance>
</livehousewaterusage>

After some research was carried out, we settled on switching to CSV files, as they are simple, easy to read from in a web app, and don't require tags around every value - the 'tags' are predefined. Thus, we've decided to use the following structure:
Files recording totals:
outlet,total
Files recording rates:
time,rate

To preview how the site would look in your home, please see our demo site; all of our code is available open-source on GitHub.

Comments

Popular posts from this blog

Website

CSV Reading/Writing