Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

XDocument::Parse Method

 

Creates a new XDocument from a string, optionally preserving white space, setting the base URI, and retaining line information.

Namespace:   System.Xml.Linq
Assembly:  System.Xml.Linq (in System.Xml.Linq.dll)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticParse(String^)

Creates a new XDocument from a string.

System_CAPS_pubmethodSystem_CAPS_staticParse(String^, LoadOptions)

Creates a new XDocument from a string, optionally preserving white space, setting the base URI, and retaining line information.

This method parses a string and creates an XML tree.

The following example creates a string that contains XML. It then parses the string into an XDocument.

No code example is currently available or this language may not be supported.

This example produces the following output:


                <!-- comment at the root level -->
<Root>
  <Child>Content</Child>
</Root>
Return to top
Show:
© 2017 Microsoft