Exemplo n.º 1
0
        /// <summary>
        /// Loads Xslt template for transformation
        /// </summary>
        /// <param name="xsltInformation"></param>
        /// <param name="settings"></param>
        public void Create(IXsltInformation xsltInformation, XsltTransformerSettings settings)
        {
            _xsltInformation = xsltInformation;
            XsltSettings   xsltSettings = new XsltSettings(true, false);
            XmlUrlResolver resolver     = new XmlUrlResolver();

            xslCompiledTransform = new XslCompiledTransform(false);
            xslCompiledTransform.Load(xsltInformation.SourceFile, xsltSettings, resolver);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Loads Xslt template for transformation
        /// </summary>
        /// <param name="xsltInformation"></param>
        /// <param name="settings"></param>
        public void Create(IXsltInformation xsltInformation, XsltTransformerSettings settings)
        {
            _xsltInformation = xsltInformation;
            if (settings.PreferredVersion == "1.0")
            {
                Version      = "1.0";
                _xsltVersion = " /xslt1 ";
            }
            else
            {
                Version      = "2.0";
                _xsltVersion = " /xslt2 ";
            }

            _exePath = GetCOMPath("AltovaXML.Application");
        }
Exemplo n.º 3
0
        public static IXsltTransformer GetXsltTransformer(IXsltInformation xsltInformation,
                                                          XsltTransformerSettings settings)
        {
            if (settings == null)
            {
                settings = new XsltTransformerSettings();
            }
            IXsltTransformer transformer;

            if (settings.PreferredVersion == "2.0" || xsltInformation.Version == "2.0")
            {
                goto AltovaExe; //Altova originally
            }
            //goto AltovaExe;

            if (settings.PreferredProvider == "Altova")
            {
                goto AltovaExe; //Altova originally
            }
            if (settings.PreferredProvider == "AltovaExe")
            {
                goto AltovaExe;
            }

            if (settings.PreferredProvider == "Microsoft")
            {
                goto Microsoft;
            }


Microsoft:
            transformer            = new MicrosoftXsltTransformer();
            transformer.Parameters = xsltInformation.Parameters;
            transformer.Create(xsltInformation, settings);
            return(transformer);

            transformer            = new AltovaXsltTransformer();
            transformer.Parameters = xsltInformation.Parameters;
            transformer.Create(xsltInformation, settings);
            return(transformer);

AltovaExe:
            transformer            = new AltovaXsltExeTransformer();
            transformer.Parameters = xsltInformation.Parameters;
            transformer.Create(xsltInformation, settings);
            return(transformer);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Loads Xslt template for transformation
 /// </summary>
 /// <param name="xsltInformation"></param>
 /// <param name="settings"></param>
 public void Create(IXsltInformation xsltInformation, XsltTransformerSettings settings)
 {
     _xsltInformation = xsltInformation;
     application      = new Application();
     if (settings.PreferredVersion == "1.0")
     {
         Version           = "1.0";
         xslt1             = application.XSLT1;
         xslt1.XSLFileName = xsltInformation.SourceFile;
     }
     else
     {
         Version           = "2.0";
         xslt2             = application.XSLT2;
         xslt2.XSLFileName = xsltInformation.SourceFile;
     }
 }
Exemplo n.º 5
0
        public static IList <IXsltTransformer> GetXsltTransformers(string transformationFile, string sectionId,
                                                                   string transformationFilesDirectory, XsltTransformerSettings xsltTransformerSettings,
                                                                   bool throwException = false)
        {
            var steps = GetTransformationFilePaths(transformationFile, sectionId, transformationFilesDirectory,
                                                   throwException);
            IList <IXsltTransformer> transformers = new List <IXsltTransformer>();

            foreach (var step in steps)
            {
                transformers.Add(GetXsltTransformer(step, xsltTransformerSettings));
            }

            return(transformers);
        }
Exemplo n.º 6
0
        public static IXsltTransformer GetXsltTransformer(string xsltFile, XsltTransformerSettings settings)
        {
            var information = GetXsltInformation(xsltFile);

            return(GetXsltTransformer(information, settings));
        }
Exemplo n.º 7
0
        public static IXsltTransformer GetXsltTransformer(string xsltFile)
        {
            var settings = new XsltTransformerSettings();

            return(GetXsltTransformer(xsltFile, settings));
        }