예제 #1
0
		public void FixtureInit()
		{
			SimpleResolver resolver = new SimpleResolver();

			resolver.BaseDirectory = TestFilesFinder.TestFilesRootDirectory;
			m_includer= new XmlIncluder (resolver);
		}
예제 #2
0
		public void FixtureInit()
		{
			SimpleResolver resolver = new SimpleResolver();

			string source = FwDirectoryFinder.SourceDirectory;
			string path = System.IO.Path.Combine(source, @"Utilities/XMLUtils/XMLUtilsTests");
			if (!System.IO.Directory.Exists(path))
			{
				Debug.Fail(path + " not found.  Have the XmlUtilsTests been moved?");
			}

			resolver.BaseDirectory = path;
			m_includer= new XmlIncluder (resolver);
		}
예제 #3
0
        /// <summary>
        /// Loads the configuration file at the specified path and resolves any nodes
        /// that need to get included from other files indicated by internal relative paths.
        /// </summary>
        /// <param name="configurationPath"></param>
        /// <param name="skipMissingFiles">if true, missing files are skipped rather than throwing exception</param>
        /// <returns></returns>
        public static XmlDocument LoadConfigurationWithIncludes(string configurationPath, bool skipMissingFiles)
        {
            XmlDocument configuration = new XmlDocument();

            configuration.Load(configurationPath);

            //process <include> elements
            SimpleResolver resolver = new SimpleResolver();

            //do includes relative to the dir of our config file
            resolver.BaseDirectory = System.IO.Path.GetDirectoryName(configurationPath);
            XmlIncluder includer = new XmlIncluder(resolver);

            includer.SkipMissingFiles = skipMissingFiles;
            includer.ProcessDom(configurationPath, configuration);
            return(configuration);
        }
예제 #4
0
		/// <summary>
		/// Loads the configuration file at the specified path and resolves any nodes
		/// that need to get included from other files indicated by internal relative paths.
		/// </summary>
		/// <param name="configurationPath"></param>
		/// <param name="skipMissingFiles">if true, missing files are skipped rather than throwing exception</param>
		/// <returns></returns>
		public static XmlDocument LoadConfigurationWithIncludes(string configurationPath, bool skipMissingFiles)
		{
			XmlDocument configuration = new XmlDocument();

			configuration.Load(configurationPath);

			//process <include> elements
			SimpleResolver resolver = new SimpleResolver();

			//do includes relative to the dir of our config file
			resolver.BaseDirectory = System.IO.Path.GetDirectoryName(configurationPath);
			XmlIncluder includer = new XmlIncluder(resolver);
			includer.SkipMissingFiles = skipMissingFiles;
			includer.ProcessDom(configurationPath, configuration);
			return configuration;
		}