예제 #1
0
        internal void run()
        {
            //question 02


            var ediREsultList = EdiParser.loadFromString(util._edifactString);

            string[][] result = ediREsultList.Select(list => list.DataElements.Split(new char[] { '&' })).ToArray();
            Console.WriteLine("---------------------------------------------------------- ");
            Console.WriteLine("Question 1  ");
            Console.WriteLine("---------------------------------------------------------- ");
            foreach (var item in result)
            {
                Console.WriteLine("{" + item[0].ToString() + "," + item[1].ToString() + "}"); // Assumes a console application
            }


            Console.WriteLine(" ");
            Console.WriteLine("---------------------------------------------------------- ");
            List <string> itensToBeListed = new List <string> {
                "MWB", "TRV", "CAR"
            };

            Console.WriteLine("Question 2 ");
            Console.WriteLine("---------------------------------------------------------- ");

            string path = Path.GetFullPath("../../../ABM/XML/Question2.xml");

            var resultQuestion2 = ExtractXML.LoadFromString(path, "Reference", "RefCode", itensToBeListed);

            foreach (var it in resultQuestion2)
            {
                Console.WriteLine("{" + it.Identifier + "," + it.value + "}");
            }


            Console.WriteLine(" ");
            Console.WriteLine("Question 3 ");
            Console.WriteLine("---------------------------------------------------------- ");

            string path3   = Path.GetFullPath("../../../ABM/XML/Question3.xml");
            string pathxsd = Path.GetFullPath("../../../ABM/XML/Question3.xsd");

            //     var b = XmlValidatorToXSD.load(path3);
            ServiceReference1.IService1 obj = new ServiceReference1.Service1Client();
            int resultQuestion3             = obj.ValidationXml(path3, pathxsd);

            Console.WriteLine("{" + resultQuestion3 + "}");  // Assumes a console application

            Console.ReadLine();
        }
예제 #2
0
        public void TestMethod1()
        {
            string edifactString = @"UNA:+.? 
                                    'UNB + UNOC:3 + 2021000969 + 4441963198 + 180525:1225 + 3VAL2MJV6EH9IX + KMSV7HMD + CUSDECU - IE++1++1'
                                    UNH + EDIFACT + CUSDEC:D: 96B: UN: 145050'
                                    BGM + ZEM:::EX + 09SEE7JPUV5HC06IC6 + Z'
                                    LOC + 17 + IT044100+555'
                                    LOC + 18 + SOL+456'
                                    LOC + 35 + SE'
                                    LOC + 36'
                                    LOC + 116 + SE003033'
                                    DTM + 9:20090527:102'
                                    DTM + 268:20090626:102'
                                    DTM + 182:20090527:102'";

            var tes = EdiParser.loadFromString(edifactString);
        }