Skip to content

M_CodeJam_Xml_XNodeExtensions_RequiredRoot_1

andrewvk edited this page Mar 30, 2016 · 8 revisions

XNodeExtensions.RequiredRoot Method (XDocument, XName)

[This is preliminary documentation and is subject to change.]

Returns document root, or throws an exception, if root is null or has another name.

Namespace: CodeJam.Xml
Assembly: CodeJam (in CodeJam.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#

[NotNullAttribute]
[PureAttribute]
public static XElement RequiredRoot(
	[NotNullAttribute] this XDocument document,
	[NotNullAttribute] XName rootName
)

VB

<ExtensionAttribute>
<NotNullAttribute>
<PureAttribute>
Public Shared Function RequiredRoot ( 
	<NotNullAttribute> document As XDocument,
	<NotNullAttribute> rootName As XName
) As XElement

F#

[<ExtensionAttribute>]
[<NotNullAttribute>]
[<PureAttribute>]
static member RequiredRoot : 
        [<NotNullAttribute>] document : XDocument * 
        [<NotNullAttribute>] rootName : XName -> XElement 

Parameters

 

document
Type: System.Xml.Linq.XDocument
[Missing documentation for "M:CodeJam.Xml.XNodeExtensions.RequiredRoot(System.Xml.Linq.XDocument,System.Xml.Linq.XName)"]
rootName
Type: System.Xml.Linq.XName
[Missing documentation for "M:CodeJam.Xml.XNodeExtensions.RequiredRoot(System.Xml.Linq.XDocument,System.Xml.Linq.XName)"]

Return Value

Type: XElement
[Missing documentation for "M:CodeJam.Xml.XNodeExtensions.RequiredRoot(System.Xml.Linq.XDocument,System.Xml.Linq.XName)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type XDocument. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also

Reference

XNodeExtensions Class
RequiredRoot Overload
CodeJam.Xml Namespace

Clone this wiki locally