Show / Hide Table of Contents

Class Document

A HTML Document.

Inheritance
System.Object
Node
Element
Document
Inherited Members
Element.TagName
Element.Tag
Element.IsBlock
Element.Id
Element.Dataset
Element.Parent
Element.Parents
Element.Child(Int32)
Element.Children
Element.TextNodes
Element.DataNodes
Element.Select(String)
Element.AppendChild(Node)
Element.PrependChild(Node)
Element.InsertChildren(Int32, IEnumerable<Node>)
Element.AppendElement(String)
Element.PrependElement(String)
Element.AppendText(String)
Element.PrependText(String)
Element.Append(String)
Element.Prepend(String)
Element.Before(String)
Element.Before(Node)
Element.After(String)
Element.After(Node)
Element.Empty()
Element.Wrap(String)
Element.CssSelector
Element.SiblingElements
Element.NextElementSibling
Element.PreviousElementSibling
Element.FirstElementSibling
Element.ElementSiblingIndex
Element.LastElementSibling
Element.GetElementsByTag(String)
Element.GetElementById(String)
Element.GetElementsByClass(String)
Element.GetElementsByAttribute(String)
Element.GetElementsByAttributeStarting(String)
Element.GetElementsByAttributeValue(String, String)
Element.GetElementsByAttributeValueNot(String, String)
Element.GetElementsByAttributeValueStarting(String, String)
Element.GetElementsByAttributeValueEnding(String, String)
Element.GetElementsByAttributeValueContaining(String, String)
Element.GetElementsByAttributeValueMatching(String, Regex)
Element.GetElementsByAttributeValueMatching(String, String)
Element.GetElementsByIndexLessThan(Int32)
Element.GetElementsByIndexGreaterThan(Int32)
Element.GetElementsByIndexEquals(Int32)
Element.GetElementsContainingText(String)
Element.GetElementsContainingOwnText(String)
Element.GetElementsMatchingText(Regex)
Element.GetElementsMatchingText(String)
Element.GetElementsMatchingOwnText(Regex)
Element.GetElementsMatchingOwnText(String)
Element.GetAllElements()
Element.OwnText
Element.HasText
Element.Data
Element.ClassName
Element.ClassNames
Element.HasClass(String)
Element.AddClass(String)
Element.RemoveClass(String)
Element.ToggleClass(String)
Element.Val
Element.Html
Element.ToString()
Element.Equals(Object)
Element.GetHashCode()
Node.Attr(String)
Node.Attributes
Node.Attr(String, String)
Node.HasAttr(String)
Node.RemoveAttr(String)
Node.BaseUri
Node.AbsUrl(String)
Node.ChildNode(Int32)
Node.ChildNodes
Node.ChildNodesCopy()
Node.ChildNodeSize
Node.OwnerDocument
Node.Remove()
Node.Unwrap()
Node.ReplaceWith(Node)
Node.SiblingNodes
Node.NextSibling
Node.PreviousSibling
Node.SiblingIndex
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

body

Head

Accessor to the document's head element.

Declaration
public Element Head { get; }
Property Value
Type Description
Element

head

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
Node.OuterHtml

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
FluentUtility

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
FluentUtility

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
Element.Text
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
FluentUtility

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. a )

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.

Extension Methods

FluentUtility.Text(Document, String)
FluentUtility.OutputSettings(Document, DocumentOutputSettings)
FluentUtility.QuirksMode(Document, DocumentQuirksMode)
FluentUtility.TagName(Element, String)
FluentUtility.ClassNames(Element, ICollection<String>)
FluentUtility.Val(Element, String)
FluentUtility.Html(Element, String)
Back to top Generated by DocFX