示例#1
0
        public void WriteCompact_FromDB()
        {
            var dsdPath   = Utility.GetPath("lib\\StructureSample.xml");
            var structure = StructureMessage.Load(dsdPath);
            var keyFamily = structure.KeyFamilies[0];

            string targetNameSpace = "urn:sdmx:org.sdmx.infomodel.keyfamily.KeyFamily=BIS:EXT_DEBT:compact";

            string dataPath = Utility.GetPath("lib\\CompactSample22.xml");

            using (var reader = GetReader())
            {
                var settings = new XmlWriterSettings()
                {
                    Indent = true
                };

                using (var writer = new CompactDataWriter(dataPath, keyFamily, settings, "bisc", targetNameSpace))
                {
                    writer.WriteHeader(GetHeader());
                    writer.Write(reader);
                }
            }

            string compactSchema = Utility.GetPath("lib\\BIS_JOINT_DEBT_Compact.xsd");

            Assert.IsTrue(Utility.IsValidMessage(XDocument.Load(dataPath), Utility.GetComapctSchema(dsdPath, targetNameSpace)));
        }
        public void convert_format_from_file_to_file()
        {
            var    structure = StructureMessage.Load(Utility.GetPath("lib\\StructureSample.xml"));
            string dataPath  = Utility.GetPath("lib\\GenericSample.xml");
            var    keyFamily = structure.KeyFamilies[0];

            using (var reader = DataReader.Create(dataPath, keyFamily))
                using (var writer = new CompactDataWriter("path", keyFamily, "uis", "ns"))
                {
                    writer.Write(reader);
                }
        }
        public void read_from_database_into_file_quit_if_notValid()
        {
            var    structure = StructureMessage.Load(Utility.GetPath("lib\\StructureSample.xml"));
            string dataPath  = Utility.GetPath("lib\\GenericSample.xml");
            var    keyFamily = structure.KeyFamilies[0];

            IDataReader reader = null;

            using (reader)
                using (var writer = new CompactDataWriter("path", keyFamily, "uis", "ns"))
                {
                    writer.WriteHeader(null);
                    writer.Write(reader);
                }
        }
示例#4
0
        public void WriteCompact_FromDB()
        {
            var dsdPath = Utility.GetPath("lib\\StructureSample.xml");
            var structure = StructureMessage.Load(dsdPath);
            var keyFamily = structure.KeyFamilies[0];
            
            string targetNameSpace = "urn:sdmx:org.sdmx.infomodel.keyfamily.KeyFamily=BIS:EXT_DEBT:compact";

            string dataPath = Utility.GetPath("lib\\CompactSample22.xml");
            using (var reader = GetReader())
            {
                var settings = new XmlWriterSettings() { Indent = true };
                
                using (var writer = new CompactDataWriter(dataPath, keyFamily, settings, "bisc", targetNameSpace))
                {
                    writer.WriteHeader(GetHeader());
                    writer.Write(reader);
                }
            }

            string compactSchema = Utility.GetPath("lib\\BIS_JOINT_DEBT_Compact.xsd");
            Assert.IsTrue(Utility.IsValidMessage(XDocument.Load(dataPath), Utility.GetComapctSchema(dsdPath, targetNameSpace)));
        }
        public void read_from_database_into_file_quit_if_notValid()
        {
            var structure = StructureMessage.Load(Utility.GetPath("lib\\StructureSample.xml"));
            string dataPath = Utility.GetPath("lib\\GenericSample.xml");
            var keyFamily = structure.KeyFamilies[0];

            IDataReader reader = null;
            using (reader)
            using (var writer = new CompactDataWriter("path", keyFamily, "uis", "ns"))
            {
                writer.WriteHeader(null);
                writer.Write(reader);
            }
        }
 public void convert_format_from_file_to_file()
 {
     var structure = StructureMessage.Load(Utility.GetPath("lib\\StructureSample.xml"));
     string dataPath = Utility.GetPath("lib\\GenericSample.xml");
     var keyFamily = structure.KeyFamilies[0];
                 
     using (var reader = DataReader.Create(dataPath, keyFamily))
     using (var writer = new CompactDataWriter("path", keyFamily, "uis", "ns"))
     {
         writer.Write(reader);
     }
 }