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

Glossary Item Box

Returns the value (if any) of this html element

Syntax

Visual Basic (Declaration) 
Public Property Value As String
C# 
public string Value {get; set;}

Example

Library/Library.Test/TestHtmlParser.cs

C#Copy Code
XmlLightElement root = new XmlLightElement(null, "root");
new XmlLightElement(root, "a").Attributes["b"] = "c";
new XmlLightElement(root, XmlLightElement.TEXT).Value = "Normal & <Encoded> Text";
new XmlLightElement(root, XmlLightElement.COMMENT).OriginalTag = "<!-- This is just a <simple> comment. -->";
new XmlLightElement(root, XmlLightElement.CONTROL){
    OriginalTag = "<? Hey, that isn't valid !>"
}.Remove();

StringWriter sw = new StringWriter();
root.WriteUnformatted(sw);
Assert.AreEqual("<root><a b=\"c\"/>Normal &amp; &lt;Encoded&gt; Text<!-- This is just a <simple> comment. --></root>", sw.ToString());
VB.NETCopy Code
Dim root As New XmlLightElement(Nothing, "root")
New XmlLightElement(root, "a").Attributes("b") = "c"
New XmlLightElement(root, XmlLightElement.TEXT).Value = "Normal & <Encoded> Text"
New XmlLightElement(root, XmlLightElement.COMMENT).OriginalTag = "<!-- This is just a <simple> comment. -->"
New XmlLightElement(root, XmlLightElement.CONTROL) With { _
    Key .OriginalTag = "<? Hey, that isn't valid !>" _
}.Remove()

Dim sw As New StringWriter()
root.WriteUnformatted(sw)
Assert.AreEqual("<root><a b=""c""/>Normal &amp; &lt;Encoded&gt; Text<!-- This is just a <simple> comment. --></root>", sw.ToString())

Requirements

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

See Also

Generated with Document! X 2011 by Innovasys