static void Main(string[] args) { IElementReader reader = new ElementReader(); var items = reader.Read(path1); IElementWriter writer = new ElementWriter(); writer.Write(items, path2); }
static void Main(string[] args) { IElementReader reader = new ElementReader(); var items = reader.Read(filePathFromXML); IElementWriter writer = new ElementWriter(); writer.Write(items, filePathToJSON); }
private static void WriteSingleDetail <T>(XmlTextWriter writer, string key, T detail) { var type = SerializationUtility.GetTypeAndAssemblyName(typeof(T)); using (var td = new ElementWriter("li", writer)) { td.WriteAttribute("data-key", key); td.WriteAttribute("data-type", type); try { td.WriteCData(detail.ToString()); } catch { td.Write("NULL"); } } }