XmlElementSyntax Class

An element written with a start tag and an end tag, and whatever stands between them.

public sealed class XmlElementSyntax : XmlNodeSyntax
Inheritance
XmlNodeSyntax XmlElementSyntax

Properties

NameDescription
AttributesGets the attributes the start tag declares.
Content
EndTag
NameGets the name the start tag declares.
StartTag

Gets the attributes the start tag declares.

public SyntaxList<XmlAttributeSyntax> Attributes { get; }
public SyntaxList<XmlNodeSyntax> Content { get; }

No documentation is available.

public XmlElementEndTagSyntax? EndTag { get; }

No documentation is available.

Gets the name the start tag declares.

public string Name { get; }

Property value

string

public XmlElementStartTagSyntax StartTag { get; }

No documentation is available.

Methods

NameDescription
Accept(XmlSyntaxVisitor)
Accept<TResult>(XmlSyntaxVisitor<TResult>)
GetAttribute(string)Gets the first attribute called name, or null when there is none.
GetInnerText()Gets the text between the two tags, exactly as it was written.
Update(XmlElementStartTagSyntax, SyntaxList<XmlNodeSyntax>, XmlElementEndTagSyntax?)Returns this node with the given parts, or itself when nothing changed.
WithContent(SyntaxList<XmlNodeSyntax>)
WithEndTag(XmlElementEndTagSyntax?)
WithInnerText(string)Returns this element with text as its only content.
WithName(string)Returns this element renamed, in both of its tags.
WithStartTag(XmlElementStartTagSyntax)

Accept overloads

Accept(XmlSyntaxVisitor)

XmlElementSyntax.cs
public override void Accept(XmlSyntaxVisitor visitor)
Parameters
visitor XmlSyntaxVisitor

No documentation is available.

Accept<TResult>(XmlSyntaxVisitor<TResult>)

XmlElementSyntax.cs
public override TResult? Accept<TResult>(XmlSyntaxVisitor<TResult> visitor)
Type parameters
TResult
Parameters
visitor XmlSyntaxVisitor<TResult>
Returns

TResult?

No documentation is available.

GetAttribute(string)

XmlElementSyntax.cs

Gets the first attribute called name, or null when there is none.

public XmlAttributeSyntax? GetAttribute(string name)

Parameters

name string

Returns

XmlAttributeSyntax?

Exceptions

ArgumentNullException
name is null.

GetInnerText()

XmlElementSyntax.cs

Gets the text between the two tags, exactly as it was written.

public string GetInnerText()

Returns

string

Update(XmlElementStartTagSyntax, SyntaxList<XmlNodeSyntax>, XmlElementEndTagSyntax?)

XmlElementSyntax.cs

Returns this node with the given parts, or itself when nothing changed.

WithContent(SyntaxList<XmlNodeSyntax>)

XmlElementSyntax.cs
public XmlElementSyntax WithContent(SyntaxList<XmlNodeSyntax> content)

No documentation is available.

WithEndTag(XmlElementEndTagSyntax?)

XmlElementSyntax.cs
public XmlElementSyntax WithEndTag(XmlElementEndTagSyntax? endTag)

No documentation is available.

WithInnerText(string)

XmlElementSyntax.cs

Returns this element with text as its only content.

public XmlElementSyntax WithInnerText(string text)

Parameters

text string

Returns

XmlElementSyntax

Exceptions

ArgumentNullException
text is null.

WithName(string)

XmlElementSyntax.cs

Returns this element renamed, in both of its tags.

public XmlElementSyntax WithName(string name)

Parameters

name string

Returns

XmlElementSyntax

Exceptions

ArgumentNullException
name is null.

WithStartTag(XmlElementStartTagSyntax)

XmlElementSyntax.cs
public XmlElementSyntax WithStartTag(XmlElementStartTagSyntax startTag)

No documentation is available.