Updated Canvas XML structure

Canvas XML Structure has been changed to allow for additional meta data to be stored along with the data items.

XML, Code, Canvas, C#

Here's the C# required to convert old XML content to the new structure.

Additionally, the ID counter is now stored along with the dataItems, this makes it much easier to hand about XML Files.

With this structure we can easily add any additional Meta Data associated a given DataItem along side the Data for the Collection of items.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace FixDataTables {
  class Program {
    static void Main(string[] args) {
      var path = @"C:\Net4orce\fix-tbls\BlankSite\data";

      foreach (var file in Directory.GetFiles(path, "*.xml", SearchOption.AllDirectories)){            
        fixFile(file);
      }

      Console.ReadLine();
    }

    private static void fixFile(string file) {
      var content = "";
      using (var reader = new StreamReader(file)) {
        content = reader.ReadToEnd();
      }

      var head = @"xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">";
      if (!content.Contains(head)) { return; }

      Console.WriteLine(string.Format("Fixing : {0}", file));

      content = content.Replace(
        head,
        head + "<items>"
      );

      var foot = "";
      content = content.Replace(
        foot,
        "</items>" + foot
      );

      using (var writer = new StreamWriter(file)) {
        writer.Write(content);
      }
    }
  }
}