Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            IElementReader reader = new ElementReader();
            var            items  = reader.Read(path1);

            IElementWriter writer = new ElementWriter();

            writer.Write(items, path2);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            IElementReader reader = new ElementReader();
            var            items  = reader.Read(filePathFromXML);

            IElementWriter writer = new ElementWriter();

            writer.Write(items, filePathToJSON);
        }
Ejemplo n.º 3
0
        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"); }
            }
        }