ProcessingInstruction Class

https://dom.spec.whatwg.org/#interface-processinginstruction

public sealed class ProcessingInstruction : CharacterData
Inheritance
CharacterData ProcessingInstruction

Constructors

NameDescription
ProcessingInstruction(string, string)Creates a processing instruction with the given target and data.

ProcessingInstruction(string, string)

ProcessingInstruction.cs

Creates a processing instruction with the given target and data.

public ProcessingInstruction(string target, string data)

Properties

NameDescription
NodeNameGets the target of the processing instruction.
NodeTypeGets the node type of a processing instruction.
Sheethttps://drafts.csswg.org/cssom/#dom-linkstyle-sheet
TargetGets the target of the processing instruction.

Gets the target of the processing instruction.

public override string NodeName { get; }

Property value

string

Gets the node type of a processing instruction.

public override ushort NodeType { get; }

Property value

ushort

https://drafts.csswg.org/cssom/#dom-linkstyle-sheet

public CssStyleSheet? Sheet { get; }

Gets the target of the processing instruction.

public string Target { get; }

Methods

NameDescription
GetAttribute(string)https://dom.spec.whatwg.org/#get-a-processing-instruction-attribute
GetAttributeNames()Returns the names of the pseudo-attributes of the data, in order.
HasAttribute(string)Returns whether the data contains the pseudo-attribute.
HasAttributes()Returns whether the data contains at least one pseudo-attribute.
RemoveAttribute(string)Removes a pseudo-attribute and updates the data accordingly.
SetAttribute(string, string)Sets a pseudo-attribute and updates the data accordingly.
ToggleAttribute(string, bool?)Adds or removes a pseudo-attribute, optionally forced, and returns whether it is present afterwards.

GetAttribute(string)

ProcessingInstruction.cs

https://dom.spec.whatwg.org/#get-a-processing-instruction-attribute

public string? GetAttribute(string name)

GetAttributeNames()

ProcessingInstruction.cs

Returns the names of the pseudo-attributes of the data, in order.

public IReadOnlyList<string> GetAttributeNames()

HasAttribute(string)

ProcessingInstruction.cs

Returns whether the data contains the pseudo-attribute.

public bool HasAttribute(string name)

Returns whether the data contains at least one pseudo-attribute.

public bool HasAttributes()

RemoveAttribute(string)

ProcessingInstruction.cs

Removes a pseudo-attribute and updates the data accordingly.

public void RemoveAttribute(string name)

SetAttribute(string, string)

ProcessingInstruction.cs

Sets a pseudo-attribute and updates the data accordingly.

public void SetAttribute(string name, string value)

ToggleAttribute(string, bool?)

ProcessingInstruction.cs

Adds or removes a pseudo-attribute, optionally forced, and returns whether it is present afterwards.

public bool ToggleAttribute(string name, bool? force = null)