Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Xml.​XmlDocumentFragment
Assembly: System.Xml.ReaderWriter
Inheritance: object → XmlNode → XmlDocumentFragment
Implemented Interfaces
- Collections.​IEnumerable Implemented by: XmlNode
- ICloneable Implemented by: XmlNode
- IXPathNavigable Implemented by: XmlNode
Represents a lightweight object that is useful for tree insert operations.
Properties
public
string
InnerXml
Gets or sets the markup representing the children of this node.
public
string
LocalName
Gets the local name of the node.
public
string
Name
Gets the qualified name of the node.
public
XmlNodeType
NodeType
Gets the type of the current node.
public
XmlDocument
OwnerDocument
Gets the <see cref="T:System.Xml.XmlDocument" /> to which this node belongs.
public
XmlNode
ParentNode
Gets the parent of this node (for nodes that can have parents).
public
XmlAttributeCollection
Attributes
Gets an <see cref="T:System.Xml.XmlAttributeCollection" /> containing the attributes of this node.
public
string
BaseURI
Gets the base URI of the current node.
public
XmlNodeList
ChildNodes
Gets all the child nodes of the node.
public
XmlNode
FirstChild
Gets the first child of the node.
public
bool
HasChildNodes
Gets a value indicating whether this node has any child nodes.
public
string
InnerText
Gets or sets the concatenated values of the node and all its child nodes.
public
bool
IsReadOnly
Gets a value indicating whether the node is read-only.
public
XmlElement
Item
public
XmlElement
Item
public
XmlNode
LastChild
Gets the last child of the node.
public
string
NamespaceURI
Gets the namespace URI of this node.
public
XmlNode
NextSibling
Gets the node immediately following this node.
public
string
OuterXml
Gets the markup containing this node and all its child nodes.
public
string
Prefix
Gets or sets the namespace prefix of this node.
public
XmlNode
PreviousSibling
Gets the node immediately preceding this node.
public
XmlNode
PreviousText
Gets the text node that immediately precedes this node.
public
IXmlSchemaInfo
SchemaInfo
Gets the post schema validation infoset that has been assigned to this node as a result of schema validation.
public
string
Value
Gets or sets the value of the node.
Methods
Returns The cloned node.
deep
<see langword="true" /> to recursively clone the subtree under the specified node; <see langword="false" /> to clone only the node itself.
public
void
WriteContentTo​(XmlWriter w)
Saves all the children of the node to the specified <see cref="T:System.Xml.XmlWriter" /> .
w
The <see langword="XmlWriter" /> to which you want to save.
public
void
WriteTo​(XmlWriter w)
Saves the node to the specified <see cref="T:System.Xml.XmlWriter" /> .
w
The <see langword="XmlWriter" /> to which you want to save.
public
XmlNode
AppendChild​(XmlNode newChild)
Inherited from XmlNode
Adds the specified node to the end of the list of child nodes, of this node.
Returns The node added.
newChild
The node to add. All the contents of the node to be added are moved into the specified location.
Returns The cloned node.
public
XPathNavigator
CreateNavigator​()
Inherited from XmlNode
Creates an <see cref="T:System.Xml.XPath.XPathNavigator" /> for navigating this object.
Returns An <see langword="XPathNavigator" /> object used to navigate the node. The <see langword="XPathNavigator" /> is positioned on the node from which the method was called. It is not positioned on the root of the document.
GetEnumerator​()
Inherited from XmlNode
Gets an enumerator that iterates through the child nodes in the current node.
Returns An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the child nodes in the current node.
public
string
GetNamespaceOfPrefix​(string prefix)
Inherited from XmlNode
Looks up the closest xmlns declaration for the given prefix that is in scope for the current node and returns the namespace URI in the declaration.
Returns The namespace URI of the specified prefix.
prefix
The prefix whose namespace URI you want to find.
public
string
GetPrefixOfNamespace​(string namespaceURI)
Inherited from XmlNode
Looks up the closest xmlns declaration for the given namespace URI that is in scope for the current node and returns the prefix defined in that declaration.
Returns The prefix for the specified namespace URI.
namespaceURI
The namespace URI whose prefix you want to find.
public
XmlNode
InsertAfter​(XmlNode newChild,
XmlNode refChild)
Inherited from XmlNode
Inserts the specified node immediately after the specified reference node.
Returns The node being inserted.
newChild
The node to insert.
refChild
The reference node. <paramref name="newChild" /> is placed after <paramref name="refChild" /> .
public
XmlNode
InsertBefore​(XmlNode newChild,
XmlNode refChild)
Inherited from XmlNode
Inserts the specified node immediately before the specified reference node.
Returns The node being inserted.
newChild
The node to insert.
refChild
The reference node. <paramref name="newChild" /> is placed before this node.
public
void
Normalize​()
Inherited from XmlNode
Puts all XmlText nodes in the full depth of the sub-tree underneath this XmlNode into a "normal" form where only markup (that is, tags, comments, processing instructions, CDATA sections, and entity references) separates XmlText nodes, that is, there are no adjacent XmlText nodes.
public
XmlNode
PrependChild​(XmlNode newChild)
Inherited from XmlNode
Adds the specified node to the beginning of the list of child nodes for this node.
Returns The node added.
newChild
The node to add. All the contents of the node to be added are moved into the specified location.
public
void
RemoveAll​()
Inherited from XmlNode
Removes all the child nodes and/or attributes of the current node.
public
XmlNode
RemoveChild​(XmlNode oldChild)
Inherited from XmlNode
Removes specified child node.
Returns The node removed.
oldChild
The node being removed.
public
XmlNode
ReplaceChild​(XmlNode newChild,
XmlNode oldChild)
Inherited from XmlNode
Replaces the child node <paramref name="oldChild" /> with <paramref name="newChild" /> node.
Returns The node replaced.
newChild
The new node to put in the child list.
oldChild
The node being replaced in the list.
public
XmlNodeList
SelectNodes​(string xpath)
Inherited from XmlNode
Selects a list of nodes matching the XPath expression.
Returns An <see cref="T:System.Xml.XmlNodeList" /> containing a collection of nodes matching the XPath query.
xpath
The XPath expression.
public
XmlNodeList
SelectNodes​(string xpath,
XmlNamespaceManager nsmgr)
Inherited from XmlNode
Selects a list of nodes matching the XPath expression. Any prefixes found in the XPath expression are resolved using the supplied <see cref="T:System.Xml.XmlNamespaceManager" /> .
Returns An <see cref="T:System.Xml.XmlNodeList" /> containing a collection of nodes matching the XPath query.
xpath
The XPath expression. See XPath Examples.
nsmgr
An <see cref="T:System.Xml.XmlNamespaceManager" /> to use for resolving namespaces for prefixes in the XPath expression.
public
XmlNode
SelectSingleNode​(string xpath)
Inherited from XmlNode
Selects the first <see langword="XmlNode" /> that matches the XPath expression.
Returns The first <see langword="XmlNode" /> that matches the XPath query or <see langword="null" /> if no matching node is found.
xpath
The XPath expression. See XPath Examples.
public
XmlNode
SelectSingleNode​(string xpath,
XmlNamespaceManager nsmgr)
Inherited from XmlNode
Selects the first <see langword="XmlNode" /> that matches the XPath expression. Any prefixes found in the XPath expression are resolved using the supplied <see cref="T:System.Xml.XmlNamespaceManager" /> .
Returns The first <see langword="XmlNode" /> that matches the XPath query or <see langword="null" /> if no matching node is found.
xpath
The XPath expression. See XPath Examples.
nsmgr
An <see cref="T:System.Xml.XmlNamespaceManager" /> to use for resolving namespaces for prefixes in the XPath expression.
public
bool
Supports​(string feature,
string version)
Inherited from XmlNode
Tests if the DOM implementation implements a specific feature.
Returns <see langword="true" /> if the feature is implemented in the specified version; otherwise, <see langword="false" /> . The following table describes the combinations that return <see langword="true" /> .
<list type="table">
<listheader>
<term> Feature</term>
<description> Version</description>
</listheader>
<item>
<term> XML</term>
<description> 1.0</description>
</item>
<item>
<term> XML</term>
<description> 2.0</description>
</item>
</list>
feature
The package name of the feature to test. This name is not case-sensitive.
version
The version number of the package name to test. If the version is not specified (null), supporting any version of the feature causes the method to return true.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object