TryParseXElement Method
Definition
- Assemblies
- Cuemon.Xml.dll
TryParseXElement(IDecorator<string>, out XElement)
public static bool TryParseXElement(this IDecorator<string> decorator, out XElement result)
Parameters
decoratorIDecorator<string>The IDecorator<T> to extend.
resultXElementWhen this method returns, it contains the XElement populated from the enclosed string of the specified
decoratorthat contains XML, if the conversion succeeded, or a null reference if the conversion failed.
Returns
- bool
trueif the enclosed string of the specifieddecoratorwas converted successfully; otherwise,false.
TryParseXElement(IDecorator<string>, LoadOptions, out XElement)
Tries to load an XElement from the enclosed string of the specified decorator that contains XML, optionally preserving white space and retaining line information.
public static bool TryParseXElement(this IDecorator<string> decorator, LoadOptions options, out XElement result)
Parameters
decoratorIDecorator<string>The IDecorator<T> to extend.
optionsLoadOptionsA LoadOptions that specifies white space behavior, and whether to load base URI and line information.
resultXElementWhen this method returns, it contains the XElement populated from the enclosed string of the specified
decoratorthat contains XML, if the conversion succeeded, or a null reference if the conversion failed.