Class ElementFragment
Represents a HTML element.
Inherited Members
Namespace: EPiServer.HtmlParsing
Assembly: EPiServer.Framework.dll
Version: 12.0.3Syntax
public class ElementFragment : TokenFragmentBase<ElementToken>
Constructors
ElementFragment()
Initializes a new instance of the Element
Declaration
public ElementFragment()
Properties
Attributes
Gets the attributes for this HTML element.
Declaration
public AttributeCollection Attributes { get; }
Property Value
Type | Description |
---|---|
Attribute |
The attributes. |
CallbackOnEndElement
Gets or sets the callback to perform when a matching End element is found.
Declaration
public Action CallbackOnEndElement { get; set; }
Property Value
Type | Description |
---|---|
System. |
The System. |
Remarks
By setting this property to an Action when a Element
Important! This setting is mirrored by the CallbackOnEndElement property on HtmlStreamReader, but it is recommended to use the property on ElementFragment since it is much more consistent with the data flow.
HasAttributes
Gets a value indicating whether this instance has attributes.
Declaration
public bool HasAttributes { get; }
Property Value
Type | Description |
---|---|
System. |
|
Methods
Parse(IHtmlParserContext)
Parses a HTML element.
Declaration
public override void Parse(IHtmlParserContext context)
Parameters
Type | Name | Description |
---|---|---|
IHtml |
context | The context. |
Overrides
Remarks
The initial '<' has already been consumed and parsing continues until the entire element has been properly parsed.
ToWriter(TextWriter)
Outputs this HTML element to the writer.
Declaration
public override void ToWriter(TextWriter writer)
Parameters
Type | Name | Description |
---|---|---|
System. |
writer | The writer. |