Mega Code Archive

 
Categories / VB.Net / XML
 

Gets or sets the tag format of the element

Imports System Imports System.Xml public class Sample   public shared sub Main()       Dim doc as XmlDocument = new XmlDocument()       doc.LoadXml("<book>" & _                   "  <title>C#</title>" & _                   "  <price/>" & _                   "</book>")          Dim currNode as XmlElement        currNode = CType (doc.DocumentElement.LastChild, XmlElement)       if (currNode.IsEmpty)         currNode.InnerXml="9.9"       end if       Console.WriteLine(doc.OuterXml)   end sub end class