-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathDtdInstruction.cs
More file actions
58 lines (53 loc) · 1.7 KB
/
DtdInstruction.cs
File metadata and controls
58 lines (53 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace Waher.Content.Html
{
/// <summary>
/// Represents a DTD instruction inside the document.
/// </summary>
public class DtdInstruction : HtmlNode
{
private readonly string instruction;
/// <summary>
/// Represents a DTD instruction inside the document.
/// </summary>
/// <param name="Document">HTML Document.</param>
/// <param name="Parent">Parent element. Can be null for root elements.</param>
/// <param name="StartPosition">Start position.</param>
/// <param name="EndPosition">End position.</param>
/// <param name="Instruction">Instruction</param>
public DtdInstruction(HtmlDocument Document, HtmlElement Parent, int StartPosition,
int EndPosition, string Instruction)
: base(Document, Parent, StartPosition, EndPosition)
{
this.instruction = Instruction;
}
/// <summary>
/// Unparsed DTD instruction.
/// </summary>
public string Instruction => this.instruction;
/// <summary>
/// Exports the HTML document to XML.
/// </summary>
/// <param name="Namespaces">Namespaces defined, by prefix.</param>
/// <param name="Output">XML Output</param>
public override void Export(XmlWriter Output, Dictionary<string, string> Namespaces)
{
Output.WriteRaw("<!");
Output.WriteRaw(this.instruction);
Output.WriteRaw(">");
}
/// <summary>
/// Exports the HTML document to XML.
/// </summary>
/// <param name="Output">XML Output</param>
public override void Export(StringBuilder Output)
{
Output.Append("<!");
Output.Append(this.instruction);
Output.Append(">");
}
}
}