Class Document
A HTML Document.
Inherited Members
Namespace: Supremes.Nodes
Assembly: Supremes.dll
Syntax
public sealed class Document : Element
Properties
Body
Accessor to the document's body element.
Declaration
public Element Body { get; }
Property Value
| Type | Description |
|---|---|
| Element |
|
Head
Accessor to the document's
head
element.
Declaration
public Element Head { get; }
Property Value
| Type | Description |
|---|---|
| Element |
|
Location
Get the URL this Document was parsed from.
Declaration
public string Location { get; }
Property Value
| Type | Description |
|---|---|
| System.String | location |
Remarks
If the starting URL is a redirect, this will return the final URL from which the document was served from.
OuterHtml
Get the outer HTML of this document.
Declaration
public override sealed string OuterHtml { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Overrides
OutputSettings
Get or Set the document's current output settings.
Declaration
public DocumentOutputSettings OutputSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| DocumentOutputSettings | new output settings |
Remarks
if you want to use fluent API, write using Supremes.Fluent;.
See Also
QuirksMode
Get or Set the document's quirks mode.
Declaration
public DocumentQuirksMode QuirksMode { get; set; }
Property Value
| Type | Description |
|---|---|
| DocumentQuirksMode |
Remarks
if you want to use fluent API, write using Supremes.Fluent;.
See Also
Text
Get or Set the combined text of this element and all its children.
Declaration
public override string Text { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | unencoded text |
Overrides
Remarks
when get, whitespace is normalized and trimmed.
For example, given HTML
<p>Hello <b>there</b> now! </p>,
p.Text returns "Hello there now!"
when set, any existing contents (text or elements) will be cleared.
if you want to use fluent API, write using Supremes.Fluent;.
See Also
Title
Get or Set the string contents of the document's title element.
Declaration
public string Title { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | string to set as title |
Remarks
when set, updates the existing element,
or adds title to head if not present
Methods
CreateElement(String)
Create a new Element, with this document's base uri.
Declaration
public Element CreateElement(string tagName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | tagName | element tag name (e.g.
|
Returns
| Type | Description |
|---|---|
| Element | new element |
Remarks
Does not make the new element a child of this document.
CreateShell(String)
Create a valid, empty shell of a document, suitable for adding more elements to.
Declaration
public static Document CreateShell(string baseUri)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | baseUri | baseUri of document |
Returns
| Type | Description |
|---|---|
| Document | document with html, head, and body elements. |