CSharpTest.Net
IsEmpty Property
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Html Namespace > XmlLightElement Class : IsEmpty Property

Glossary Item Box

Returns true if the node is self-closing (i.e. ends with '/>')

Syntax

Visual Basic (Declaration) 
Public Property IsEmpty As Boolean
C# 
public bool IsEmpty {get; set;}

Example

Library/Library.Test/TestHtmlParser.cs

C#Copy Code
HtmlLightDocument doc = new HtmlLightDocument();
XmlLightElement body = new XmlLightElement(new XmlLightElement(doc, "html"), "body");
body.IsEmpty = false;
body.Attributes.Add("id", "bdy");
Assert.AreEqual("<html> <body id=\"bdy\"> </body> </html>", Normalize(doc.InnerXml));
VB.NETCopy Code
Dim doc As New HtmlLightDocument()
Dim body As New XmlLightElement(New XmlLightElement(doc, "html"), "body")
body.IsEmpty = False
body.Attributes.Add("id", "bdy")
Assert.AreEqual("<html> <body id=""bdy""> </body> </html>", Normalize(doc.InnerXml))

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys