Пример #1
0
        public void CreateCodeList()
        {
            var codelist = new CodeList(new InternationalString("en", "Countries"), "CL_COUNTRY", "UIS");

            var code = new Code("CAN");
            code.Description["en"] = "Canada";
            codelist.Add(code);

            code = new Code("USA");
            code.Description["en"] = "United States of America";
            codelist.Add(code);

            var message = new StructureMessage();
            message.Header = new Header("MSD_HDR", new Party("UIS")) { Prepared = DateTime.Now };            
            message.CodeLists.Add(codelist);
            message.Save("CL_COUNTRY.xml");
        }
Пример #2
0
        public void HeirarchicalCodeListSample()
        {
            string dsdPath = Utility.GetPath("lib\\HeirarchicalCodeListSample.xml");
            var    sample  = XDocument.Load(dsdPath);

            using (var reader = sample.CreateReader())
                Assert.IsTrue(MessageValidator.ValidateXml(reader));

            StructureMessageMap map = new StructureMessageMap();

            StructureMessage message = StructureMessage.Load(dsdPath);

            message.Save(Utility.GetPath("lib\\HeirarchicalCodeListSample2.xml"));

            var doc = XDocument.Load(Utility.GetPath("lib\\HeirarchicalCodeListSample2.xml"));

            using (var reader = doc.CreateReader())
                Assert.IsTrue(MessageValidator.ValidateXml(reader));
        }
Пример #3
0
        public void CreateCodeList()
        {
            var codelist = new CodeList(new InternationalString("en", "Countries"), "CL_COUNTRY", "UIS");

            var code = new Code("CAN");

            code.Description["en"] = "Canada";
            codelist.Add(code);

            code = new Code("USA");
            code.Description["en"] = "United States of America";
            codelist.Add(code);

            var message = new StructureMessage();

            message.Header = new Header("MSD_HDR", new Party("UIS"))
            {
                Prepared = DateTime.Now
            };
            message.CodeLists.Add(codelist);
            message.Save("CL_COUNTRY.xml");
        }