当前位置: 首页>>代码示例>>C#>>正文


C# XPathNavigator.WriteSubtree方法代码示例

本文整理汇总了C#中System.Xml.XPath.XPathNavigator.WriteSubtree方法的典型用法代码示例。如果您正苦于以下问题:C# XPathNavigator.WriteSubtree方法的具体用法?C# XPathNavigator.WriteSubtree怎么用?C# XPathNavigator.WriteSubtree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.XPath.XPathNavigator的用法示例。


在下文中一共展示了XPathNavigator.WriteSubtree方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateAssemblyWriter

        private static XmlWriter CreateAssemblyWriter(string path, XPathNavigator assembly)
        {
            XmlWriterSettings settings = new XmlWriterSettings { Indent = true };
            XmlWriter writer = XmlWriter.Create(path, settings);

            writer.WriteStartElement("reflection");

            if(assembly != null)
            {
                writer.WriteStartElement("assemblies");
                assembly.WriteSubtree(writer);
                writer.WriteEndElement();
            }

            writer.WriteStartElement("apis");

            return writer;
        }
开发者ID:modulexcite,项目名称:SHFB-1,代码行数:18,代码来源:Program.cs

示例2: ProcessXPathNavigator

        private void ProcessXPathNavigator(XPathNavigator xpathNavigator)
        {
            try
            {
                using (StringWriter stringWriter = new StringWriter())
                {
                    using (XmlWriter xmlWriter = XmlWriter.Create(stringWriter, XmlWriterSettings))
                    {
                        xpathNavigator.WriteSubtree(xmlWriter);
                    }

                    WriteObject(stringWriter.ToString());
                }
            }
            catch (PipelineStoppedException)
            {
                throw;
            }
            catch (Exception ex)
            {
                ErrorHandler.WriteXmlError(ex);
            }
        }
开发者ID:nickchal,项目名称:pash,代码行数:23,代码来源:FormatXmlCommand.cs

示例3: WriteSubtree

		string WriteSubtree (XPathNavigator nav)
		{
			StringWriter sw = new StringWriter ();
			XmlWriterSettings settings = new XmlWriterSettings ();
			settings.OmitXmlDeclaration = true;
			settings.ConformanceLevel = ConformanceLevel.Fragment;
			using (XmlWriter w = XmlWriter.Create (sw, settings)) {
				nav.WriteSubtree(w);
			}
			return sw.ToString ();
		}
开发者ID:nobled,项目名称:mono,代码行数:11,代码来源:XmlWriterTests.cs

示例4: XPathNavigatorToString

		// I avoided OuterXml which includes indentation.
		string XPathNavigatorToString (XPathNavigator nav)
		{
			var sw = new StringWriter ();
			using (var xw = XmlWriter.Create (sw, xml_writer_settings))
				nav.WriteSubtree (xw);
			return sw.ToString ();
		}
开发者ID:Xipas,项目名称:Symplified.Auth,代码行数:8,代码来源:XmlWriterTraceListener.cs

示例5: SaveCacheFile

        private void SaveCacheFile(XPathNavigator nav)
        {
            if (String.IsNullOrEmpty(cacheFile))
                return;

            XmlWriterSettings settings = new XmlWriterSettings();
            settings.Indent = true;
            settings.NewLineHandling = NewLineHandling.None;

            try
            {
                using (XmlWriter writer = XmlWriter.Create(cacheFile, settings))
                {
                    nav.WriteSubtree(writer);
                }
            }
            catch (Exception)
            {
                // derp!
            }
        }
开发者ID:ISeeDEDPpl,项目名称:Questor,代码行数:21,代码来源:APIReader.cs

示例6: Initialize

 private void Initialize(XPathNavigator navigator)
 {
   using (MemoryStream memStream = new MemoryStream())
   {
     using (XmlWriter writer = XmlWriter.Create(memStream))
     {
       navigator.WriteSubtree(writer);
       writer.Flush();
       memStream.Position = 0;
       Initialize(memStream);
     }
   }
 }
开发者ID:dlemstra,项目名称:Magick.NET,代码行数:13,代码来源:MagickScript.cs

示例7: NavigatorToStream

 public static Stream NavigatorToStream(XPathNavigator nav){
     var sw = new MemoryStream();
     var w = new XmlTextWriter(sw, Encoding.UTF8);
     nav.WriteSubtree(w);
     w.Flush();
     sw.Position = 0;
     return sw;
 }
开发者ID:Qorpent,项目名称:comdiv.oldcore,代码行数:8,代码来源:XmlUtil.cs

示例8: GetXElement

        protected static XElement GetXElement(XPathNavigator navigator)
        {
            XDocument xDoc = new XDocument();

            using (XmlWriter xmlWriter = xDoc.CreateWriter())

                navigator.WriteSubtree(xmlWriter);

            return xDoc.Root;
        }
开发者ID:DBailey635,项目名称:C1-CMS,代码行数:10,代码来源:StandardExtension.cs


注:本文中的System.Xml.XPath.XPathNavigator.WriteSubtree方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。