示例#1
0
        private Xslt CompileTransform([NotNull] XsltSettings staticSettings)
        {
            Assert.ArgumentNotNull(staticSettings, "staticSettings");

            // TODO: use AnyUri when it fully supports windows paths
            var uri = new Uri(Xsl.GetMetadata("FullPath"));

            staticSettings.BaseURI = new AnyUri(uri);
            return(Xslt.Compile(uri, staticSettings));
        }
示例#2
0
        /// <summary>
        /// Writes RemoteInstall output to an XML file, also generates an XSL file in the same directory to use for XSLT
        /// </summary>
        public void Write(Results results, string fileName)
        {
            XmlDocument xml             = results.GetXml();
            string      xslFileName     = Path.Combine(Path.GetDirectoryName(fileName), Path.GetFileNameWithoutExtension(fileName) + ".xsl");
            XmlProcessingInstruction pi = xml.CreateProcessingInstruction("xml-stylesheet", string.Format("type=\"text/xsl\" href=\"{0}\"", Path.GetFileName(xslFileName)));

            xml.InsertAfter(pi, xml.FirstChild);
            xml.Save(fileName);
            Xsl.Save(xslFileName);
        }