Create XML Root Attribute - CSharp System.Xml

CSharp examples for System.Xml:XML Attribute

Description

Create XML Root Attribute

Demo Code

/*==============================================================================
 *  Copyright (c) trenhui.  All rights reserved.
 * ===============================================================================
 * This code and information is provided "as is" without warranty of any kind,
 * either expressed or implied, including but not limited to the implied warranties
 * of merchantability and fitness for a particular purpose.
 * ===============================================================================
 * This code is only for study/* w w w  .  ja  v a2  s .  c  o m*/
 * ==============================================================================*/
using System.Xml.Serialization;
using System.IO;
using System;

public class Main{
        private static XmlRootAttribute CreateXMLRootAttribute(string psRootName)
        {
            // Create an XmlRootAttribute overloaded constructer 
            //and set its namespace.
            XmlRootAttribute newXmlRootAttribute = null;
            if (psRootName != null && psRootName != string.Empty)
            {
                newXmlRootAttribute = new XmlRootAttribute(psRootName);
            }
            return newXmlRootAttribute;
        }
}

Related Tutorials