Creates XML Attribute and assigns a value, to the specified XmlDocument and XmlElement. - CSharp System.Xml

CSharp examples for System.Xml:XML Document

Description

Creates XML Attribute and assigns a value, to the specified XmlDocument and XmlElement.

Demo Code


using System.Xml.Linq;
using System.Linq;
using System;//from   w  w w.  j  av a 2 s. c  o  m
using System.IO;
using System.Xml;
using System.Collections.Generic;
using System.Collections;
using UnityEngine;

public class Main{

   /// <summary>
   /// Creates an Attribute and assigns a value, to the specified XmlDocument and XmlElement.
   /// </summary>
   public static void CreateAttribute(string attName, string val, ref XElement elem)
   {
      XAttribute att = new XAttribute(attName, val);
      elem.Add(att);
   }
}

Related Tutorials