Table of Contents

TryParseXElement Method

Definition

Namespace
Cuemon.Extensions.Xml.Linq
Assemblies
Cuemon.Extensions.Xml.dll
Source
src/Cuemon.Extensions.Xml/Linq/StringExtensions.cs

TryParseXElement(string, out XElement)

Tries to load an XElement from a value that contains XML.

public static bool TryParseXElement(this string value, out XElement result)

Parameters

value string

The string to extend.

result XElement

When this method returns, it contains the XElement populated from the value that contains XML, if the conversion succeeded, or a null reference (Nothing in Visual Basic) if the conversion failed.

Returns

bool

true if the value parameter was converted successfully; otherwise, false.

TryParseXElement(string, LoadOptions, out XElement)

Tries to load an XElement from a value that contains XML, optionally preserving white space and retaining line information.

public static bool TryParseXElement(this string value, LoadOptions options, out XElement result)

Parameters

value string

The string to extend.

options LoadOptions

A LoadOptions that specifies white space behavior, and whether to load base URI and line information.

result XElement

When this method returns, it contains the XElement populated from the value that contains XML, if the conversion succeeded, or a null reference (Nothing in Visual Basic) if the conversion failed.

Returns

bool

true if the value parameter was converted successfully; otherwise, false.