Пример #1
0
        public static bool Validate_SDMXMLFile(SDMXSchemaType schemaType, string dataFileNameWPath)
        {
            bool Retval;
            Dictionary<string, string> dictStatus;
            BaseValidateUtility BaseValidateUtility;
            string ValidationStatus;

            dictStatus = new Dictionary<string, string>();
            BaseValidateUtility = null;
            Retval = true;
            ValidationStatus = string.Empty;

            try
            {
                BaseValidateUtility = new SDMXMLValidateUtility();
                dictStatus = BaseValidateUtility.ValidateSdmxML(dataFileNameWPath);
                foreach (string key in dictStatus.Keys)
                {
                    ValidationStatus = key;
                }
                if ((ValidationStatus == SDMXValidationStatus.Valid.ToString()) || (dictStatus.Keys.Count == 0))
                {
                    Retval = true;
                }
                else
                {
                    Retval = false;
                }
            }
            catch (Exception ex)
            {
                Retval = false;
                throw ex;
            }
            finally
            {
            }

            return Retval;
        }
Пример #2
0
        public static Dictionary<string, string> Validate_SDMXML(SDMXSchemaType schemaType, string dataFileNameWPath, string completeFileNameWPath)
        {
            Dictionary<string, string> RetVal;
            BaseValidateUtility BaseValidateUtility;

            RetVal = new Dictionary<string, string>();
            BaseValidateUtility = null;

            try
            {
                BaseValidateUtility = new SDMXMLValidateUtility();
                RetVal = BaseValidateUtility.ValidateSdmxMlAgainstDSD(dataFileNameWPath, completeFileNameWPath);
                if (RetVal.Keys.Count == 0)
                {
                    RetVal.Add(SDMXValidationStatus.Valid.ToString(), string.Empty);
                }
            }
            catch (Exception ex)
            {
                RetVal = new Dictionary<string, string>();
                throw ex;
            }
            finally
            {
            }

            return RetVal;
        }