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


C# XmlNode.WriteTo方法代码示例

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


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

示例1: GetXElement

 private XElement GetXElement(XmlNode node)
 {
     XDocument xDoc = new XDocument();
     using (XmlWriter xmlWriter = xDoc.CreateWriter())
         node.WriteTo(xmlWriter);
     return xDoc.Root;
 }
开发者ID:gtkrug,项目名称:gfipm-ws-ms.net,代码行数:7,代码来源:WspClaimsAuthorizationManager.cs

示例2: GetXElement

 private static XElement GetXElement(XmlNode node) {
     var xDoc = new XDocument();
     using (XmlWriter xmlWriter = xDoc.CreateWriter()) {
         node.WriteTo(xmlWriter);
     }
     return xDoc.Root;
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:7,代码来源:NakedObjectsClaimsAuthorizationManager.cs

示例3: XmlConverter

        public XmlConverter(XmlNode e)
            : this()
        {
            Contract.Requires(e != null);


            e.WriteTo(_writer);
        }
开发者ID:RyanLiu99,项目名称:Thinktecture.IdentityModel,代码行数:8,代码来源:XmlConverter.cs

示例4: GetXmlFragment

 static string GetXmlFragment(XmlNode node)
 {
     using (var stringWriter = new StringWriter())
     using (var xmlFragmentWriter = new XmlFragmentWriter(stringWriter))
     {
         xmlFragmentWriter.Formatting = Formatting.Indented;
         node.WriteTo(xmlFragmentWriter);
         return stringWriter.GetStringBuilder().ToString();
     }
 }
开发者ID:steveski,项目名称:crispin,代码行数:10,代码来源:InternalHelpers.cs

示例5: GetXml

 internal static string GetXml(XmlNode node)
 {
     using (var stringWriter = new StringWriter())
     using (var xmlTextWriter = XmlWriter.Create(stringWriter))
     {
         node.WriteTo(xmlTextWriter);
         xmlTextWriter.Flush();
         return stringWriter.GetStringBuilder().ToString();
     }
 }
开发者ID:steveski,项目名称:crispin,代码行数:10,代码来源:InternalHelpers.cs

示例6: Create

 /// Standard callback
 public object Create(object parent, object configContext, XmlNode section)
 {
     using (MemoryStream ms = new MemoryStream())
     {
         using (XmlWriter xw = XmlWriter.Create(ms))
             section.WriteTo(xw);
         ms.Position = 0;
         return ms.ToArray();
     }
 }
开发者ID:xsharper,项目名称:xsharper,代码行数:11,代码来源:Utils.Various.cs

示例7: WriteXmlOutput

        private void WriteXmlOutput(XmlNode resultNode, XmlWriter xmlWriter)
        {
            this.xmlWriter = xmlWriter;

            InitializeXmlFile(resultNode);

            resultNode.WriteTo(xmlWriter);

            TerminateXmlFile();
        }
开发者ID:haf,项目名称:nunit-framework,代码行数:10,代码来源:NUnit3TestResultWriter.cs

示例8: FormattedXml

 private static string FormattedXml(XmlNode node)
 {
     using (TextWriter textwriter = new StringWriter())
     {
         XmlTextWriter writer = new XmlTextWriter(textwriter);
         writer.Formatting = Formatting.Indented;
         node.WriteTo(writer);
         return textwriter.ToString();
     }
 }
开发者ID:marcinczekaj,项目名称:v1-jira-integration,代码行数:10,代码来源:AssertXml.cs

示例9: WriteResultFile

        public void WriteResultFile(XmlNode resultNode, TextWriter writer)
        {
            var settings = new XmlWriterSettings();
            settings.Indent = true;

            using (XmlWriter xmlWriter = XmlWriter.Create(writer, settings))
            {
                xmlWriter.WriteStartDocument(false);
                resultNode.WriteTo(xmlWriter);
            }
        }
开发者ID:JohanLarsson,项目名称:nunit,代码行数:11,代码来源:NUnit3XmlResultWriter.cs

示例10: StudyXmlNode

			public StudyXmlNode(XmlNode node)
			{
				using (TextWriter writer = new Utf8StringWriter())
				{
					using (XmlWriter xmlWriter = XmlWriter.Create(writer,new XmlWriterSettings(){ConformanceLevel = ConformanceLevel.Fragment}))
					{
						node.WriteTo(xmlWriter);
					}
					XmlElementFragment = writer.ToString();
				}
			}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:11,代码来源:StudyXmlMemento.cs

示例11: GetStream

        public static Stream GetStream(XmlNode node)
        {
            MemoryStream stream = new MemoryStream();
            XmlWriter writer = XmlWriter.Create(stream);
            node.WriteTo(writer);
            writer.Flush();

            stream.Seek(0, SeekOrigin.Begin);

            return stream;
        }
开发者ID:juanplopes,项目名称:simple,代码行数:11,代码来源:XmlHelper.cs

示例12: FormatRawMessage

        private static String FormatRawMessage(XmlNode document)
        {
            var sb = new StringBuilder();

            using (var stringWriter = new StringWriter(sb))
            using (var xmlTextWriter = new XmlTextWriter(stringWriter))
            {
                xmlTextWriter.Formatting = Formatting.Indented;

                document.WriteTo(xmlTextWriter);
            }

            return sb.ToString();
        }
开发者ID:SHSE,项目名称:Harvester,代码行数:14,代码来源:Log4JParserForRemoteMessage.cs

示例13: FormatXml

        private static string FormatXml(XmlNode node)
        {
            var settings = new XmlWriterSettings();
              settings.OmitXmlDeclaration = true;
              settings.Indent = true;
              settings.IndentChars = "  ";

              using (var output = new StringWriter())
              {
            using (var writer = XmlTextWriter.Create(output, settings))
            {
              node.WriteTo(writer);
            }
            return output.ToString();
              }
        }
开发者ID:Barnickle,项目名称:InnovatorAdmin,代码行数:16,代码来源:ErrorWindow.cs

示例14: WriteXmlNode

		void WriteXmlNode (XmlNode node)
		{
			if (node is XmlDocument)
				node = ((XmlDocument) node).DocumentElement;

			node.WriteTo (Writer);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:7,代码来源:XmlSerializationWriter.cs

示例15: WriteNodeTo

			public void WriteNodeTo (XmlNode node)
			{
				node.WriteTo (output);
			}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:4,代码来源:ecma2wiki.cs


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