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.​XPath.​XPathNavigator

Assembly: System.Xml.ReaderWriter

Inheritance: object → XPathItem → XPathNavigator

Implemented Interfaces

Provides a cursor model for navigating and editing XML data.

Properties

public string
BaseURI
When overridden in a derived class, gets the base URI for the current node.
public bool
CanEdit
Gets a value that indicates whether the <see cref="T:System.Xml.XPath.XPathNavigator" /> can edit the underlying XML data.
public bool
HasAttributes
Gets a value that indicates whether the current node has any attributes.
public bool
HasChildren
Gets a value that indicates whether the current node has any child nodes.
public string
InnerXml
Gets or sets the markup representing the child nodes of the current node.
public bool
IsEmptyElement
When overridden in a derived class, gets a value that indicates whether the current node is an empty element without an end element tag.
public bool
IsNode
Gets a value that indicates if the current node represents an XPath node.
public string
LocalName
When overridden in a derived class, gets the <see cref="P:System.Xml.XPath.XPathNavigator.Name" /> of the current node without any namespace prefix.
public string
Name
When overridden in a derived class, gets the qualified name of the current node.
public string
NamespaceURI
When overridden in a derived class, gets the namespace URI of the current node.
public XmlNameTable
NameTable
When overridden in a derived class, gets the <see cref="T:System.Xml.XmlNameTable" /> of the <see cref="T:System.Xml.XPath.XPathNavigator" /> .
NavigatorComparer
Gets an <see cref="T:System.Collections.IEqualityComparer" /> used for equality comparison of <see cref="T:System.Xml.XPath.XPathNavigator" /> objects.
public XPathNodeType
NodeType
When overridden in a derived class, gets the <see cref="T:System.Xml.XPath.XPathNodeType" /> of the current node.
public string
OuterXml
Gets or sets the markup representing the opening and closing tags of the current node and its child nodes.
public string
Prefix
When overridden in a derived class, gets the namespace prefix associated with the current node.
SchemaInfo
Gets the schema information that has been assigned to the current node as a result of schema validation.
public object
TypedValue
Gets the current node as a boxed object of the most appropriate .NET type.
public object
UnderlyingObject
Used by <see cref="T:System.Xml.XPath.XPathNavigator" /> implementations which provide a "virtualized" XML view over a store, to provide access to underlying objects.
public bool
ValueAsBoolean
Gets the current node's value as a <see cref="T:System.Boolean" /> .
public DateTime
ValueAsDateTime
Gets the current node's value as a <see cref="T:System.DateTime" /> .
public double
ValueAsDouble
Gets the current node's value as a <see cref="T:System.Double" /> .
public int
ValueAsInt
Gets the current node's value as an <see cref="T:System.Int32" /> .
public long
ValueAsLong
Gets the current node's value as an <see cref="T:System.Int64" /> .
public Type
ValueType
Gets the .NET <see cref="T:System.Type" /> of the current node.
public string
XmlLang
Gets the <c>xml:lang</c> scope for the current node.
XmlType
Gets the <see cref="T:System.Xml.Schema.XmlSchemaType" /> information for the current node.
public string
Value
When overridden in a derived class, gets the <see langword="string" /> value of the item.

Methods

public XmlWriter
AppendChild​()
Returns an <see cref="T:System.Xml.XmlWriter" /> object used to create one or more new child nodes at the end of the list of child nodes of the current node.
Returns An <see cref="T:System.Xml.XmlWriter" /> object used to create new child nodes at the end of the list of child nodes of the current node.
public void
AppendChild​(string newChild)
Creates a new child node at the end of the list of child nodes of the current node using the XML data string specified.
newChild The XML data string for the new child node.
public void
AppendChild​(XmlReader newChild)
Creates a new child node at the end of the list of child nodes of the current node using the XML contents of the <see cref="T:System.Xml.XmlReader" /> object specified.
newChild An <see cref="T:System.Xml.XmlReader" /> object positioned on the XML data for the new child node.
public void
AppendChild​(XPathNavigator newChild)
Creates a new child node at the end of the list of child nodes of the current node using the nodes in the <see cref="T:System.Xml.XPath.XPathNavigator" /> specified.
newChild An <see cref="T:System.Xml.XPath.XPathNavigator" /> object positioned on the node to add as the new child node.
public void
AppendChildElement​(string prefix, string localName, string namespaceURI, string value)
Creates a new child element node at the end of the list of child nodes of the current node using the namespace prefix, local name and namespace URI specified with the value specified.
prefix The namespace prefix of the new child element node (if any).
localName The local name of the new child element node (if any).
namespaceURI The namespace URI of the new child element node (if any). <see cref="F:System.String.Empty" /> and <see langword="null" /> are equivalent.
value The value of the new child element node. If <see cref="F:System.String.Empty" /> or <see langword="null" /> are passed, an empty element is created.
public bool
CheckValidity​(Schema.​XmlSchemaSet schemas, Schema.​ValidationEventHandler validationEventHandler)
Verifies that the XML data in the <see cref="T:System.Xml.XPath.XPathNavigator" /> conforms to the XML Schema definition language (XSD) schema provided.
Returns <see langword="true" /> if no schema validation errors occurred; otherwise, <see langword="false" /> .
schemas The <see cref="T:System.Xml.Schema.XmlSchemaSet" /> containing the schemas used to validate the XML data contained in the <see cref="T:System.Xml.XPath.XPathNavigator" /> .
validationEventHandler The <see cref="T:System.Xml.Schema.ValidationEventHandler" /> that receives information about schema validation warnings and errors.
Clone​()
When overridden in a derived class, creates a new <see cref="T:System.Xml.XPath.XPathNavigator" /> positioned at the same node as this <see cref="T:System.Xml.XPath.XPathNavigator" /> .
Returns A new <see cref="T:System.Xml.XPath.XPathNavigator" /> positioned at the same node as this <see cref="T:System.Xml.XPath.XPathNavigator" /> .
public XmlNodeOrder
ComparePosition​(XPathNavigator nav)
Compares the position of the current <see cref="T:System.Xml.XPath.XPathNavigator" /> with the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> specified.
Returns An <see cref="T:System.Xml.XmlNodeOrder" /> value representing the comparative position of the two <see cref="T:System.Xml.XPath.XPathNavigator" /> objects.
nav The <see cref="T:System.Xml.XPath.XPathNavigator" /> to compare against.
Compile​(string xpath)
Compiles a string representing an XPath expression and returns an <see cref="T:System.Xml.XPath.XPathExpression" /> object.
Returns An <see cref="T:System.Xml.XPath.XPathExpression" /> object representing the XPath expression.
xpath A string representing an XPath expression.
public void
CreateAttribute​(string prefix, string localName, string namespaceURI, string value)
Creates an attribute node on the current element node using the namespace prefix, local name and namespace URI specified with the value specified.
prefix The namespace prefix of the new attribute node (if any).
localName The local name of the new attribute node, which can't be <see cref="F:System.String.Empty" /> or <see langword="null" /> .
namespaceURI The namespace URI for the new attribute node (if any).
value The value of the new attribute node. If <see cref="F:System.String.Empty" /> or <see langword="null" /> are passed, an empty attribute node is created.
public XmlWriter
CreateAttributes​()
Returns an <see cref="T:System.Xml.XmlWriter" /> object used to create new attributes on the current element.
Returns An <see cref="T:System.Xml.XmlWriter" /> object used to create new attributes on the current element.
CreateNavigator​()
Returns a copy of the <see cref="T:System.Xml.XPath.XPathNavigator" /> .
Returns An <see cref="T:System.Xml.XPath.XPathNavigator" /> copy of this <see cref="T:System.Xml.XPath.XPathNavigator" /> .
public void
DeleteRange​(XPathNavigator lastSiblingToDelete)
Deletes a range of sibling nodes from the current node to the node specified.
lastSiblingToDelete An <see cref="T:System.Xml.XPath.XPathNavigator" /> positioned on the last sibling node in the range to delete.
public void
DeleteSelf​()
Deletes the current node and its child nodes.
public object
Evaluate​(string xpath)
Evaluates the specified XPath expression and returns the typed result.
Returns The result of the expression (Boolean, number, string, or node set). This maps to <see cref="T:System.Boolean" /> , <see cref="T:System.Double" /> , <see cref="T:System.String" /> , or <see cref="T:System.Xml.XPath.XPathNodeIterator" /> objects respectively.
xpath A string representing an XPath expression that can be evaluated.
public object
Evaluate​(string xpath, IXmlNamespaceResolver? resolver)
Evaluates the specified XPath expression and returns the typed result, using the <see cref="T:System.Xml.IXmlNamespaceResolver" /> object specified to resolve namespace prefixes in the XPath expression.
Returns The result of the expression (Boolean, number, string, or node set). This maps to <see cref="T:System.Boolean" /> , <see cref="T:System.Double" /> , <see cref="T:System.String" /> , or <see cref="T:System.Xml.XPath.XPathNodeIterator" /> objects respectively.
xpath A string representing an XPath expression that can be evaluated.
resolver The <see cref="T:System.Xml.IXmlNamespaceResolver" /> object used to resolve namespace prefixes in the XPath expression.
public object
Evaluate​(XPathExpression expr)
Evaluates the <see cref="T:System.Xml.XPath.XPathExpression" /> and returns the typed result.
Returns The result of the expression (Boolean, number, string, or node set). This maps to <see cref="T:System.Boolean" /> , <see cref="T:System.Double" /> , <see cref="T:System.String" /> , or <see cref="T:System.Xml.XPath.XPathNodeIterator" /> objects respectively.
expr An <see cref="T:System.Xml.XPath.XPathExpression" /> that can be evaluated.
public object
Evaluate​(XPathExpression expr, XPathNodeIterator? context)
Uses the supplied context to evaluate the <see cref="T:System.Xml.XPath.XPathExpression" /> , and returns the typed result.
Returns The result of the expression (Boolean, number, string, or node set). This maps to <see cref="T:System.Boolean" /> , <see cref="T:System.Double" /> , <see cref="T:System.String" /> , or <see cref="T:System.Xml.XPath.XPathNodeIterator" /> objects respectively.
expr An <see cref="T:System.Xml.XPath.XPathExpression" /> that can be evaluated.
context An <see cref="T:System.Xml.XPath.XPathNodeIterator" /> that points to the selected node set that the evaluation is to be performed on.
public string
GetAttribute​(string localName, string namespaceURI)
Gets the value of the attribute with the specified local name and namespace URI.
Returns A <see cref="T:System.String" /> that contains the value of the specified attribute; <see cref="F:System.String.Empty" /> if a matching attribute is not found, or if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is not positioned on an element node.
localName The local name of the attribute. <paramref name="localName" /> is case-sensitive.
namespaceURI The namespace URI of the attribute.
public string
GetNamespace​(string name)
Returns the value of the namespace node corresponding to the specified local name.
Returns A <see cref="T:System.String" /> that contains the value of the namespace node; <see cref="F:System.String.Empty" /> if a matching namespace node is not found, or if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is not positioned on an element node.
name The local name of the namespace node.
public Collections.​Generic.​IDictionary<​string, string>
GetNamespacesInScope​(XmlNamespaceScope scope)
Returns the in-scope namespaces of the current node.
Returns An <see cref="T:System.Collections.Generic.IDictionary`2" /> collection of namespace names keyed by prefix.
scope An <see cref="T:System.Xml.XmlNamespaceScope" /> value specifying the namespaces to return.
public XmlWriter
InsertAfter​()
Returns an <see cref="T:System.Xml.XmlWriter" /> object used to create a new sibling node after the currently selected node.
Returns An <see cref="T:System.Xml.XmlWriter" /> object used to create a new sibling node after the currently selected node.
public void
InsertAfter​(string newSibling)
Creates a new sibling node after the currently selected node using the XML string specified.
newSibling The XML data string for the new sibling node.
public void
InsertAfter​(XmlReader newSibling)
Creates a new sibling node after the currently selected node using the XML contents of the <see cref="T:System.Xml.XmlReader" /> object specified.
newSibling An <see cref="T:System.Xml.XmlReader" /> object positioned on the XML data for the new sibling node.
public void
InsertAfter​(XPathNavigator newSibling)
Creates a new sibling node after the currently selected node using the nodes in the <see cref="T:System.Xml.XPath.XPathNavigator" /> object specified.
newSibling An <see cref="T:System.Xml.XPath.XPathNavigator" /> object positioned on the node to add as the new sibling node.
public XmlWriter
InsertBefore​()
Returns an <see cref="T:System.Xml.XmlWriter" /> object used to create a new sibling node before the currently selected node.
Returns An <see cref="T:System.Xml.XmlWriter" /> object used to create a new sibling node before the currently selected node.
public void
InsertBefore​(string newSibling)
Creates a new sibling node before the currently selected node using the XML string specified.
newSibling The XML data string for the new sibling node.
public void
InsertBefore​(XmlReader newSibling)
Creates a new sibling node before the currently selected node using the XML contents of the <see cref="T:System.Xml.XmlReader" /> object specified.
newSibling An <see cref="T:System.Xml.XmlReader" /> object positioned on the XML data for the new sibling node.
public void
InsertBefore​(XPathNavigator newSibling)
Creates a new sibling node before the currently selected node using the nodes in the <see cref="T:System.Xml.XPath.XPathNavigator" /> specified.
newSibling An <see cref="T:System.Xml.XPath.XPathNavigator" /> object positioned on the node to add as the new sibling node.
public void
InsertElementAfter​(string prefix, string localName, string namespaceURI, string value)
Creates a new sibling element after the current node using the namespace prefix, local name and namespace URI specified, with the value specified.
prefix The namespace prefix of the new child element (if any).
localName The local name of the new child element (if any).
namespaceURI The namespace URI of the new child element (if any). <see cref="F:System.String.Empty" /> and <see langword="null" /> are equivalent.
value The value of the new child element. If <see cref="F:System.String.Empty" /> or <see langword="null" /> are passed, an empty element is created.
public void
InsertElementBefore​(string prefix, string localName, string namespaceURI, string value)
Creates a new sibling element before the current node using the namespace prefix, local name, and namespace URI specified, with the value specified.
prefix The namespace prefix of the new child element (if any).
localName The local name of the new child element (if any).
namespaceURI The namespace URI of the new child element (if any). <see cref="F:System.String.Empty" /> and <see langword="null" /> are equivalent.
value The value of the new child element. If <see cref="F:System.String.Empty" /> or <see langword="null" /> are passed, an empty element is created.
public bool
IsDescendant​(XPathNavigator nav)
Determines whether the specified <see cref="T:System.Xml.XPath.XPathNavigator" /> is a descendant of the current <see cref="T:System.Xml.XPath.XPathNavigator" /> .
Returns <see langword="true" /> if the specified <see cref="T:System.Xml.XPath.XPathNavigator" /> is a descendant of the current <see cref="T:System.Xml.XPath.XPathNavigator" /> ; otherwise, <see langword="false" /> .
nav The <see cref="T:System.Xml.XPath.XPathNavigator" /> to compare to this <see cref="T:System.Xml.XPath.XPathNavigator" /> .
public bool
IsSamePosition​(XPathNavigator other)
When overridden in a derived class, determines whether the current <see cref="T:System.Xml.XPath.XPathNavigator" /> is at the same position as the specified <see cref="T:System.Xml.XPath.XPathNavigator" /> .
Returns <see langword="true" /> if the two <see cref="T:System.Xml.XPath.XPathNavigator" /> objects have the same position; otherwise, <see langword="false" /> .
other The <see cref="T:System.Xml.XPath.XPathNavigator" /> to compare to this <see cref="T:System.Xml.XPath.XPathNavigator" /> .
public string
LookupNamespace​(string prefix)
Gets the namespace URI for the specified prefix.
Returns A <see cref="T:System.String" /> that contains the namespace URI assigned to the namespace prefix specified; <see langword="null" /> if no namespace URI is assigned to the prefix specified. The <see cref="T:System.String" /> returned is atomized.
prefix The prefix whose namespace URI you want to resolve. To match the default namespace, pass <see cref="F:System.String.Empty" /> .
public string
LookupPrefix​(string namespaceURI)
Gets the prefix declared for the specified namespace URI.
Returns A <see cref="T:System.String" /> that contains the namespace prefix assigned to the namespace URI specified; otherwise, <see cref="F:System.String.Empty" /> if no prefix is assigned to the namespace URI specified. The <see cref="T:System.String" /> returned is atomized.
namespaceURI The namespace URI to resolve for the prefix.
public bool
Matches​(string xpath)
Determines whether the current node matches the specified XPath expression.
Returns <see langword="true" /> if the current node matches the specified XPath expression; otherwise, <see langword="false" /> .
xpath The XPath expression.
public bool
Matches​(XPathExpression expr)
Determines whether the current node matches the specified <see cref="T:System.Xml.XPath.XPathExpression" /> .
Returns <see langword="true" /> if the current node matches the <see cref="T:System.Xml.XPath.XPathExpression" /> ; otherwise, <see langword="false" /> .
expr An <see cref="T:System.Xml.XPath.XPathExpression" /> object containing the compiled XPath expression.
public bool
MoveTo​(XPathNavigator other)
When overridden in a derived class, moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the same position as the specified <see cref="T:System.Xml.XPath.XPathNavigator" /> .
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving to the same position as the specified <see cref="T:System.Xml.XPath.XPathNavigator" /> ; otherwise, <see langword="false" /> . If <see langword="false" /> , the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> is unchanged.
other The <see cref="T:System.Xml.XPath.XPathNavigator" /> positioned on the node that you want to move to.
public bool
MoveToAttribute​(string localName, string namespaceURI)
Moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the attribute with the matching local name and namespace URI.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving to the attribute; otherwise, <see langword="false" /> . If <see langword="false" /> , the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> is unchanged.
localName The local name of the attribute.
namespaceURI The namespace URI of the attribute; <see langword="null" /> for an empty namespace.
public bool
MoveToChild​(string localName, string namespaceURI)
Moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the child node with the local name and namespace URI specified.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving to the child node; otherwise, <see langword="false" /> . If <see langword="false" /> , the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> is unchanged.
localName The local name of the child node to move to.
namespaceURI The namespace URI of the child node to move to.
public bool
MoveToChild​(XPathNodeType type)
Moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the child node of the <see cref="T:System.Xml.XPath.XPathNodeType" /> specified.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving to the child node; otherwise, <see langword="false" /> . If <see langword="false" /> , the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> is unchanged.
type The <see cref="T:System.Xml.XPath.XPathNodeType" /> of the child node to move to.
public bool
MoveToFirst​()
Moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the first sibling node of the current node.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving to the first sibling node of the current node; <see langword="false" /> if there is no first sibling, or if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is currently positioned on an attribute node. If the <see cref="T:System.Xml.XPath.XPathNavigator" /> is already positioned on the first sibling, <see cref="T:System.Xml.XPath.XPathNavigator" /> will return <see langword="true" /> and will not move its position. If <see cref="M:System.Xml.XPath.XPathNavigator.MoveToFirst" /> returns <see langword="false" /> because there is no first sibling, or if <see cref="T:System.Xml.XPath.XPathNavigator" /> is currently positioned on an attribute, the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> is unchanged.
public bool
MoveToFirstAttribute​()
When overridden in a derived class, moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the first attribute of the current node.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving to the first attribute of the current node; otherwise, <see langword="false" /> . If <see langword="false" /> , the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> is unchanged.
public bool
MoveToFirstChild​()
When overridden in a derived class, moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the first child node of the current node.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving to the first child node of the current node; otherwise, <see langword="false" /> . If <see langword="false" /> , the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> is unchanged.
public bool
MoveToFirstNamespace​()
Moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to first namespace node of the current node.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving to the first namespace node; otherwise, <see langword="false" /> . If <see langword="false" /> , the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> is unchanged.
public bool
MoveToFirstNamespace​(XPathNamespaceScope namespaceScope)
When overridden in a derived class, moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the first namespace node that matches the <see cref="T:System.Xml.XPath.XPathNamespaceScope" /> specified.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving to the first namespace node; otherwise, <see langword="false" /> . If <see langword="false" /> , the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> is unchanged.
namespaceScope An <see cref="T:System.Xml.XPath.XPathNamespaceScope" /> value describing the namespace scope.
public bool
MoveToFollowing​(string localName, string namespaceURI)
Moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the element with the local name and namespace URI specified in document order.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> moved successfully; otherwise, <see langword="false" /> .
localName The local name of the element.
namespaceURI The namespace URI of the element.
public bool
MoveToFollowing​(string localName, string namespaceURI, XPathNavigator? end)
Moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the element with the local name and namespace URI specified, to the boundary specified, in document order.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> moved successfully; otherwise, <see langword="false" /> .
localName The local name of the element.
namespaceURI The namespace URI of the element.
end The <see cref="T:System.Xml.XPath.XPathNavigator" /> object positioned on the element boundary which the current <see cref="T:System.Xml.XPath.XPathNavigator" /> will not move past while searching for the following element.
public bool
MoveToFollowing​(XPathNodeType type)
Moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the following element of the <see cref="T:System.Xml.XPath.XPathNodeType" /> specified in document order.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> moved successfully; otherwise, <see langword="false" /> .
type The <see cref="T:System.Xml.XPath.XPathNodeType" /> of the element. The <see cref="T:System.Xml.XPath.XPathNodeType" /> cannot be <see cref="F:System.Xml.XPath.XPathNodeType.Attribute" /> or <see cref="F:System.Xml.XPath.XPathNodeType.Namespace" /> .
public bool
MoveToFollowing​(XPathNodeType type, XPathNavigator end)
Moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the following element of the <see cref="T:System.Xml.XPath.XPathNodeType" /> specified, to the boundary specified, in document order.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> moved successfully; otherwise, <see langword="false" /> .
type The <see cref="T:System.Xml.XPath.XPathNodeType" /> of the element. The <see cref="T:System.Xml.XPath.XPathNodeType" /> cannot be <see cref="F:System.Xml.XPath.XPathNodeType.Attribute" /> or <see cref="F:System.Xml.XPath.XPathNodeType.Namespace" /> .
end The <see cref="T:System.Xml.XPath.XPathNavigator" /> object positioned on the element boundary which the current <see cref="T:System.Xml.XPath.XPathNavigator" /> will not move past while searching for the following element.
public bool
MoveToId​(string id)
When overridden in a derived class, moves to the node that has an attribute of type <c>ID</c> whose value matches the specified <see cref="T:System.String" /> .
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving; otherwise, <see langword="false" /> . If <see langword="false" /> , the position of the navigator is unchanged.
id A <see cref="T:System.String" /> representing the <c>ID</c> value of the node to which you want to move.
public bool
MoveToNamespace​(string name)
Moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the namespace node with the specified namespace prefix.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving to the specified namespace; <see langword="false" /> if a matching namespace node was not found, or if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is not positioned on an element node. If <see langword="false" /> , the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> is unchanged.
name The namespace prefix of the namespace node.
public bool
MoveToNext​()
When overridden in a derived class, moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the next sibling node of the current node.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving to the next sibling node; otherwise, <see langword="false" /> if there are no more siblings or if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is currently positioned on an attribute node. If <see langword="false" /> , the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> is unchanged.
public bool
MoveToNext​(string localName, string namespaceURI)
Moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the next sibling node with the local name and namespace URI specified.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving to the next sibling node; <see langword="false" /> if there are no more siblings, or if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is currently positioned on an attribute node. If <see langword="false" /> , the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> is unchanged.
localName The local name of the next sibling node to move to.
namespaceURI The namespace URI of the next sibling node to move to.
public bool
MoveToNext​(XPathNodeType type)
Moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the next sibling node of the current node that matches the <see cref="T:System.Xml.XPath.XPathNodeType" /> specified.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving to the next sibling node; otherwise, <see langword="false" /> if there are no more siblings or if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is currently positioned on an attribute node. If <see langword="false" /> , the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> is unchanged.
type The <see cref="T:System.Xml.XPath.XPathNodeType" /> of the sibling node to move to.
public bool
MoveToNextAttribute​()
When overridden in a derived class, moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the next attribute.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving to the next attribute; <see langword="false" /> if there are no more attributes. If <see langword="false" /> , the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> is unchanged.
public bool
MoveToNextNamespace​()
Moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the next namespace node.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving to the next namespace node; otherwise, <see langword="false" /> . If <see langword="false" /> , the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> is unchanged.
public bool
MoveToNextNamespace​(XPathNamespaceScope namespaceScope)
When overridden in a derived class, moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the next namespace node matching the <see cref="T:System.Xml.XPath.XPathNamespaceScope" /> specified.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving to the next namespace node; otherwise, <see langword="false" /> . If <see langword="false" /> , the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> is unchanged.
namespaceScope An <see cref="T:System.Xml.XPath.XPathNamespaceScope" /> value describing the namespace scope.
public bool
MoveToParent​()
When overridden in a derived class, moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the parent node of the current node.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving to the parent node of the current node; otherwise, <see langword="false" /> . If <see langword="false" /> , the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> is unchanged.
public bool
MoveToPrevious​()
When overridden in a derived class, moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the previous sibling node of the current node.
Returns <see langword="true" /> if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is successful moving to the previous sibling node; otherwise, <see langword="false" /> if there is no previous sibling node or if the <see cref="T:System.Xml.XPath.XPathNavigator" /> is currently positioned on an attribute node. If <see langword="false" /> , the position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> is unchanged.
public void
MoveToRoot​()
Moves the <see cref="T:System.Xml.XPath.XPathNavigator" /> to the root node that the current node belongs to.
public XmlWriter
PrependChild​()
Returns an <see cref="T:System.Xml.XmlWriter" /> object used to create a new child node at the beginning of the list of child nodes of the current node.
Returns An <see cref="T:System.Xml.XmlWriter" /> object used to create a new child node at the beginning of the list of child nodes of the current node.
public void
PrependChild​(string newChild)
Creates a new child node at the beginning of the list of child nodes of the current node using the XML string specified.
newChild The XML data string for the new child node.
public void
PrependChild​(XmlReader newChild)
Creates a new child node at the beginning of the list of child nodes of the current node using the XML contents of the <see cref="T:System.Xml.XmlReader" /> object specified.
newChild An <see cref="T:System.Xml.XmlReader" /> object positioned on the XML data for the new child node.
public void
PrependChild​(XPathNavigator newChild)
Creates a new child node at the beginning of the list of child nodes of the current node using the nodes in the <see cref="T:System.Xml.XPath.XPathNavigator" /> object specified.
newChild An <see cref="T:System.Xml.XPath.XPathNavigator" /> object positioned on the node to add as the new child node.
public void
PrependChildElement​(string prefix, string localName, string namespaceURI, string value)
Creates a new child element at the beginning of the list of child nodes of the current node using the namespace prefix, local name, and namespace URI specified with the value specified.
prefix The namespace prefix of the new child element (if any).
localName The local name of the new child element (if any).
namespaceURI The namespace URI of the new child element (if any). <see cref="F:System.String.Empty" /> and <see langword="null" /> are equivalent.
value The value of the new child element. If <see cref="F:System.String.Empty" /> or <see langword="null" /> are passed, an empty element is created.
public XmlReader
ReadSubtree​()
Returns an <see cref="T:System.Xml.XmlReader" /> object that contains the current node and its child nodes.
Returns An <see cref="T:System.Xml.XmlReader" /> object that contains the current node and its child nodes.
public XmlWriter
ReplaceRange​(XPathNavigator lastSiblingToReplace)
Replaces a range of sibling nodes from the current node to the node specified.
Returns An <see cref="T:System.Xml.XmlWriter" /> object used to specify the replacement range.
lastSiblingToReplace An <see cref="T:System.Xml.XPath.XPathNavigator" /> positioned on the last sibling node in the range to replace.
public void
ReplaceSelf​(string newNode)
Replaces the current node with the content of the string specified.
newNode The XML data string for the new node.
public void
ReplaceSelf​(XmlReader newNode)
Replaces the current node with the contents of the <see cref="T:System.Xml.XmlReader" /> object specified.
newNode An <see cref="T:System.Xml.XmlReader" /> object positioned on the XML data for the new node.
public void
ReplaceSelf​(XPathNavigator newNode)
Replaces the current node with the contents of the <see cref="T:System.Xml.XPath.XPathNavigator" /> object specified.
newNode An <see cref="T:System.Xml.XPath.XPathNavigator" /> object positioned on the new node.
Select​(string xpath)
Selects a node set, using the specified XPath expression.
Returns An <see cref="T:System.Xml.XPath.XPathNodeIterator" /> pointing to the selected node set.
xpath A <see cref="T:System.String" /> representing an XPath expression.
Select​(string xpath, IXmlNamespaceResolver? resolver)
Selects a node set using the specified XPath expression with the <see cref="T:System.Xml.IXmlNamespaceResolver" /> object specified to resolve namespace prefixes.
Returns An <see cref="T:System.Xml.XPath.XPathNodeIterator" /> that points to the selected node set.
xpath A <see cref="T:System.String" /> representing an XPath expression.
resolver The <see cref="T:System.Xml.IXmlNamespaceResolver" /> object used to resolve namespace prefixes.
Select​(XPathExpression expr)
Selects a node set using the specified <see cref="T:System.Xml.XPath.XPathExpression" /> .
Returns An <see cref="T:System.Xml.XPath.XPathNodeIterator" /> that points to the selected node set.
expr An <see cref="T:System.Xml.XPath.XPathExpression" /> object containing the compiled XPath query.
SelectAncestors​(string name, string namespaceURI, bool matchSelf)
Selects all the ancestor nodes of the current node that have the specified local name and namespace URI.
Returns An <see cref="T:System.Xml.XPath.XPathNodeIterator" /> that contains the selected nodes. The returned nodes are in reverse document order.
name The local name of the ancestor nodes.
namespaceURI The namespace URI of the ancestor nodes.
matchSelf To include the context node in the selection, <see langword="true" /> ; otherwise, <see langword="false" /> .
SelectAncestors​(XPathNodeType type, bool matchSelf)
Selects all the ancestor nodes of the current node that have a matching <see cref="T:System.Xml.XPath.XPathNodeType" /> .
Returns An <see cref="T:System.Xml.XPath.XPathNodeIterator" /> that contains the selected nodes. The returned nodes are in reverse document order.
type The <see cref="T:System.Xml.XPath.XPathNodeType" /> of the ancestor nodes.
matchSelf To include the context node in the selection, <see langword="true" /> ; otherwise, <see langword="false" /> .
SelectChildren​(string name, string namespaceURI)
Selects all the child nodes of the current node that have the local name and namespace URI specified.
Returns An <see cref="T:System.Xml.XPath.XPathNodeIterator" /> that contains the selected nodes.
name The local name of the child nodes.
namespaceURI The namespace URI of the child nodes.
SelectChildren​(XPathNodeType type)
Selects all the child nodes of the current node that have the matching <see cref="T:System.Xml.XPath.XPathNodeType" /> .
Returns An <see cref="T:System.Xml.XPath.XPathNodeIterator" /> that contains the selected nodes.
type The <see cref="T:System.Xml.XPath.XPathNodeType" /> of the child nodes.
SelectDescendants​(string name, string namespaceURI, bool matchSelf)
Selects all the descendant nodes of the current node with the local name and namespace URI specified.
Returns An <see cref="T:System.Xml.XPath.XPathNodeIterator" /> that contains the selected nodes.
name The local name of the descendant nodes.
namespaceURI The namespace URI of the descendant nodes.
matchSelf <see langword="true" /> to include the context node in the selection; otherwise, <see langword="false" /> .
SelectDescendants​(XPathNodeType type, bool matchSelf)
Selects all the descendant nodes of the current node that have a matching <see cref="T:System.Xml.XPath.XPathNodeType" /> .
Returns An <see cref="T:System.Xml.XPath.XPathNodeIterator" /> that contains the selected nodes.
type The <see cref="T:System.Xml.XPath.XPathNodeType" /> of the descendant nodes.
matchSelf <see langword="true" /> to include the context node in the selection; otherwise, <see langword="false" /> .
SelectSingleNode​(string xpath)
Selects a single node in the <see cref="T:System.Xml.XPath.XPathNavigator" /> using the specified XPath query.
Returns An <see cref="T:System.Xml.XPath.XPathNavigator" /> object that contains the first matching node for the XPath query specified; otherwise, <see langword="null" /> if there are no query results.
xpath A <see cref="T:System.String" /> representing an XPath expression.
SelectSingleNode​(string xpath, IXmlNamespaceResolver resolver)
Selects a single node in the <see cref="T:System.Xml.XPath.XPathNavigator" /> object using the specified XPath query with the <see cref="T:System.Xml.IXmlNamespaceResolver" /> object specified to resolve namespace prefixes.
Returns An <see cref="T:System.Xml.XPath.XPathNavigator" /> object that contains the first matching node for the XPath query specified; otherwise <see langword="null" /> if there are no query results.
xpath A <see cref="T:System.String" /> representing an XPath expression.
resolver The <see cref="T:System.Xml.IXmlNamespaceResolver" /> object used to resolve namespace prefixes in the XPath query.
SelectSingleNode​(XPathExpression expression)
Selects a single node in the <see cref="T:System.Xml.XPath.XPathNavigator" /> using the specified <see cref="T:System.Xml.XPath.XPathExpression" /> object.
Returns An <see cref="T:System.Xml.XPath.XPathNavigator" /> object that contains the first matching node for the XPath query specified; otherwise <see langword="null" /> if there are no query results.
expression An <see cref="T:System.Xml.XPath.XPathExpression" /> object containing the compiled XPath query.
public void
SetTypedValue​(object typedValue)
Sets the typed value of the current node.
typedValue The new typed value of the node.
public void
SetValue​(string value)
Sets the value of the current node.
value The new value of the node.
public string
ToString​()
Gets the text value of the current node.
Returns A <see langword="string" /> that contains the text value of the current node.
public object
ValueAs​(Type returnType, IXmlNamespaceResolver? nsResolver)
Gets the current node's value as the <see cref="T:System.Type" /> specified, using the <see cref="T:System.Xml.IXmlNamespaceResolver" /> object specified to resolve namespace prefixes.
Returns The value of the current node as the <see cref="T:System.Type" /> requested.
returnType The <see cref="T:System.Type" /> to return the current node's value as.
nsResolver The <see cref="T:System.Xml.IXmlNamespaceResolver" /> object used to resolve namespace prefixes.
public void
WriteSubtree​(XmlWriter writer)
Streams the current node and its child nodes to the <see cref="T:System.Xml.XmlWriter" /> object specified.
writer The <see cref="T:System.Xml.XmlWriter" /> object to stream to.
public object
ValueAs​(Type returnType)
Inherited from XPathItem
Returns the item's value as the specified type.
Returns The value of the item as the type requested.
returnType The type to return the item value as.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object