Writes the non null XML element string. - CSharp System.Xml

CSharp examples for System.Xml:XML Element

Description

Writes the non null XML element string.

Demo Code


using System.Xml.Serialization;
using System.IO;//ww  w .  j ava  2 s .c o m
using System.Xml;
using System.Text.RegularExpressions;
using System;

public class Main{
        /// <summary>
        /// Writes the non null element string.   
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="name">The name.</param>
        /// <param name="value">The value.</param>
        /// <remarks></remarks>
      public static void WriteNonNullElementString(XmlWriter writer, string name, string value)
      {
         if (value != null)
         {
            writer.WriteElementString(name, value);
         }
      }
}

Related Tutorials