Table of Contents

Class SvgProcessingInstruction

Namespace
Egami.Svg
Assembly
Egami.Svg.dll

An XML processing instruction, such as <?xml-stylesheet ...?>, kept so a save writes it back.

public sealed class SvgProcessingInstruction : SvgContent
Inheritance
SvgProcessingInstruction
Inherited Members

Examples

SvgDocument document = SvgDocument.Parse(Icon);

// Elements, attributes and text are an editable tree, like XDocument's.
SvgElement body = document.FindById("body")!;
body.Attributes["fill"] = "#c33";
body.Attributes.Set("href", "#other", SvgNamespaces.XLink, "xlink");

SvgElement dot = new("circle");
dot.Attributes["cx"] = "12";
dot.Attributes["cy"] = "12";
dot.Attributes["r"] = "3";
document.Root.Children.Add(dot);
document.Root.Children.Add(new SvgComment(" added in code "));

foreach (SvgElement element in document.Root.Elements())
{
    Console.WriteLine($"{element.Name}: {element.Attributes.Count} attributes");
}

Constructors

SvgProcessingInstruction(string, string)

Initializes a new instance of the SvgProcessingInstruction class.

public SvgProcessingInstruction(string target, string data)

Parameters

target string

The target, such as xml-stylesheet.

data string

The text after the target.

Properties

Data

Gets the text after the target.

public string Data { get; }

Property Value

string

Target

Gets the target, such as xml-stylesheet.

public string Target { get; }

Property Value

string

Methods

Clone()

Makes a deep copy without a parent: an element is copied with its attributes and all its content.

public override SvgContent Clone()

Returns

SvgContent

The copy.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.