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

Glossary Item Box

Represents an html element

Object Model

XmlLightElement ClassXmlLightElement ClassXmlLightElement ClassXmlLightElement ClassXmlLightElement Class

Syntax

Visual Basic (Declaration) 
Public Class XmlLightElement 
C# 
public class XmlLightElement 

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())

Inheritance Hierarchy

System.Object
   CSharpTest.Net.Html.XmlLightElement
      CSharpTest.Net.Html.XmlLightDocument

Requirements

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

See Also

Generated with Document! X 2011 by Innovasys