Esempio n. 1
0
        public ActionResult ValidateDdex(string releaseType, string version, string xmlMessage)
        {
            var xmlInput = xmlMessage;

            try
            {
                if (Request.Files != null && Request.Files.Count > 0 && Request.Files[0].ContentLength > 0)
                {
                    using (var textReader = new StreamReader(Request.Files[0].InputStream))
                    {
                        xmlInput = textReader.ReadToEnd();
                    }
                }

                if (!String.IsNullOrEmpty(xmlInput))
                {
                    ViewBag.Message = _ddexValidator.TransformOutputForScreen(
                        Server.MapPath("~/Content/OutputToHtml.xslt"),
                        _ddexValidator.Transform(
                            Server.MapPath("~/"),
                            xmlInput,
                            releaseType,
                            version
                            ));
                }
            }
            catch (Exception ex)
            {
                Logger.Debug(ex.Message + ex.StackTrace);
                throw;
            }
            return(View());
        }
Esempio n. 2
0
        public ActionResult Validate(string releaseType, string version, string xmlMessage)
        {
            var schematronPath = "Content/" + releaseType.Replace(" ", "") + "." + version.Replace(".", "") + ".xslt";

            var result = _ddexValidator.TransformOutputForScreen(
                Server.MapPath("~/Content/OutputToHtml.xslt"),
                _ddexValidator.Transform(
                    Server.MapPath("~/"),
                    xmlMessage,
                    releaseType,
                    version));

            return(this.Content(result));
        }