View Single Post
05-06-15, 06:10 AM   #1
Yukyuk
A Chromatic Dragonspawn
 
Yukyuk's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 179
From table to XML

Am developing my addon, Historia.
Have set up the database as I want it, but am now running into a problem.

Can't figure out a decent way to put a table I have into the XML its supposed to go.
Its basically a simple table with the players levels and a time when the player gained that level.
Sure, I could define a 100 possible fontstring(s) in my XML file but there is problably a more elegant way to handle this.
Also would like to do this without a scrolling table.

Any help is appriciated.

Lua Code:
  1. ["Level"] = {
  2.         {
  3.             ["time"] = 1430830617,
  4.             ["level"] = 1,
  5.         }, -- [1]
  6.         {
  7.             ["time"] = 1430830830,
  8.             ["level"] = 2,
  9.         }, -- [2]
  10.         {
  11.             ["time"] = 1430845053,
  12.             ["level"] = 3,
  13.         }, -- [3]
  14.         {
  15.             ["time"] = 1430845452,
  16.             ["level"] = 4,
  17.         }, -- [4]
  18.         {
  19.             ["time"] = 1430845770,
  20.             ["level"] = 5,
  21.         }, -- [5]
  22.     }
  Reply With Quote