Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
HtmlNode.cs
1using System;
2using System.Text;
3using System.Xml;
4
5namespace Waher.Content.Html
6{
10 public abstract class HtmlNode
11 {
12 private readonly HtmlDocument document;
13 private readonly HtmlNode parent;
14 private int start;
15 private int end;
16
24 {
25 this.document = Document;
26 this.parent = Parent;
27 this.start = StartPosition;
28 this.end = -1;
29 }
30
39 {
40 this.document = Document;
41 this.parent = Parent;
42 this.start = StartPosition;
43 this.end = EndPosition;
44 }
45
49 public HtmlDocument Document => this.document;
50
54 public HtmlNode Parent => this.parent;
55
59 public int StartPosition
60 {
61 get => this.start;
62 internal set => this.start = value;
63 }
64
68 public int EndPosition
69 {
70 get => this.end;
71 internal set => this.end = value;
72 }
73
77 public string OuterHtml
78 {
79 get
80 {
81 return this.document.HtmlText.Substring(this.start, this.end - this.start + 1);
82 }
83 }
84
89 public abstract void Export(XmlWriter Output);
90
95 public abstract void Export(StringBuilder Output);
96 }
97}
Base class for all HTML nodes.
Definition: HtmlNode.cs:11
HtmlNode(HtmlDocument Document, HtmlNode Parent, int StartPosition, int EndPosition)
Base class for all HTML nodes.
Definition: HtmlNode.cs:38
HtmlNode(HtmlDocument Document, HtmlNode Parent, int StartPosition)
Base class for all HTML nodes.
Definition: HtmlNode.cs:23
int StartPosition
Start position of element.
Definition: HtmlNode.cs:60
HtmlDocument Document
HTML Document
Definition: HtmlNode.cs:49
HtmlNode Parent
Parent node, if available.
Definition: HtmlNode.cs:54
abstract void Export(XmlWriter Output)
Exports the HTML document to XML.
int EndPosition
End position of element.
Definition: HtmlNode.cs:69
string OuterHtml
Outer HTML
Definition: HtmlNode.cs:78
abstract void Export(StringBuilder Output)
Exports the HTML document to XML.