XPathNavigator

XPathNavigator class

Provides a cursor model for navigating and editing XML data.

class XPathNavigator : public System::Xml::XPath::XPathItem,
                       public System::Xml::XPath::IXPathNavigable,
                       public System::Xml::IXmlNamespaceResolver

Methods

MethodDescription
virtual SharedPtr<XmlWriter> AppendChild()Returns an XmlWriter object used to create one or more new child nodes at the end of the list of child nodes of the current node.
virtual void AppendChild(String)Creates a new child node at the end of the list of child nodes of the current node using the XML data string specified.
virtual void AppendChild(SharedPtr<XmlReader>)Creates a new child node at the end of the list of child nodes of the current node using the XML contents of the XmlReader object specified.
virtual void AppendChild(SharedPtr<XPathNavigator>)Creates a new child node at the end of the list of child nodes of the current node using the nodes in the XPathNavigator specified.
virtual void AppendChildElement(String, String, String, String)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.
virtual bool CheckValidity(SharedPtr<System::Xml::Schema::XmlSchemaSet>, System::Xml::Schema::ValidationEventHandler)Verifies that the XML data in the XPathNavigator conforms to the XML Schema definition language (XSD) schema provided.
virtual SharedPtr<XPathNavigator> Clone()When overridden in a derived class, creates a new XPathNavigator positioned at the same node as this XPathNavigator.
virtual XmlNodeOrder ComparePosition(SharedPtr<XPathNavigator>)Compares the position of the current XPathNavigator with the position of the XPathNavigator specified.
virtual SharedPtr<XPathExpression> Compile(String)Compiles a string representing an XPath expression and returns an XPathExpression object.
virtual void CreateAttribute(String, String, String, String)Creates an attribute node on the current element node using the namespace prefix, local name and namespace URI specified with the value specified.
virtual SharedPtr<XmlWriter> CreateAttributes()Returns an XmlWriter object used to create new attributes on the current element.
SharedPtr<XPathNavigator> CreateNavigator() overrideReturns a copy of the XPathNavigator.
virtual void DeleteRange(SharedPtr<XPathNavigator>)Deletes a range of sibling nodes from the current node to the node specified.
virtual void DeleteSelf()Deletes the current node and its child nodes.
virtual bool Equals(ptr)Compares objects using C# Object.Equals semantics.
static std::enable_if<IsSmartPtr<T1>::value&&IsSmartPtr<T2>::value, bool>::type Equals(T1 const&, T2 const&)Compares reference type objects in C# style.
static std::enable_if<!IsSmartPtr<T1>::value&&!IsSmartPtr<T2>::value, bool>::type Equals(T1 const&, T2 const&)Compares value type objects in C# style.
static bool Equals(float const&, float const&)Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.
static bool Equals(double const&, double const&)Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.
virtual SharedPtr<Object> Evaluate(String)Evaluates the specified XPath expression and returns the typed result.
virtual SharedPtr<Object> Evaluate(String, SharedPtr<IXmlNamespaceResolver>)Evaluates the specified XPath expression and returns the typed result, using the IXmlNamespaceResolver object specified to resolve namespace prefixes in the XPath expression.
virtual SharedPtr<Object> Evaluate(SharedPtr<XPathExpression>)Evaluates the XPathExpression and returns the typed result.
virtual SharedPtr<Object> Evaluate(SharedPtr<XPathExpression>, SharedPtr<XPathNodeIterator>)Uses the supplied context to evaluate the XPathExpression, and returns the typed result.
virtual bool FastCast(const Details::FastRttiBase&, void **) constFor internal purposes only.
virtual String get_BaseURI()When overridden in a derived class, gets the base URI for the current node.
virtual bool get_CanEdit()Returns a value that indicates whether the XPathNavigator can edit the underlying XML data.
virtual bool get_HasAttributes()Returns a value that indicates whether the current node has any attributes.
virtual bool get_HasChildren()Returns a value that indicates whether the current node has any child nodes.
virtual String get_InnerXml()Returns the markup representing the child nodes of the current node.
virtual bool get_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.
bool get_IsNode() overrideReturns a value that indicates if the current node represents an XPath node.
virtual String get_LocalName()When overridden in a derived class, gets the XPathNavigator::get_Name of the current node without any namespace prefix.
virtual String get_Name()When overridden in a derived class, gets the qualified name of the current node.
virtual String get_NamespaceURI()When overridden in a derived class, gets the namespace URI of the current node.
virtual SharedPtr<XmlNameTable> get_NameTable()When overridden in a derived class, gets the XmlNameTable of the XPathNavigator.
static SharedPtr<Collections::Generic::IEqualityComparer<SharedPtr<XPathNavigator>>> get_NavigatorComparer()Returns an Collections::IEqualityComparer used for equality comparison of XPathNavigator objects.
virtual XPathNodeType get_NodeType()When overridden in a derived class, gets the XPathNodeType of the current node.
virtual String get_OuterXml()Returns the markup representing the opening and closing tags of the current node and its child nodes.
virtual String get_Prefix()When overridden in a derived class, gets the namespace prefix associated with the current node.
virtual SharedPtr<System::Xml::Schema::IXmlSchemaInfo> get_SchemaInfo()Returns the schema information that has been assigned to the current node as a result of schema validation.
SharedPtr<Object> get_TypedValue() overrideReturns the current node as a boxed object of the most appropriate type.
virtual SharedPtr<Object> get_UnderlyingObject()Used by XPathNavigator implementations which provide a "virtualized" XML view over a store, to provide access to underlying objects.
virtual String get_Value()When overridden in a derived class, gets the string value of the item.
bool get_ValueAsBoolean() overrideReturns the current node’s value as a Boolean.
DateTime get_ValueAsDateTime() overrideReturns the current node’s value as a DateTime.
double get_ValueAsDouble() overrideReturns the current node’s value as a Double.
int32_t get_ValueAsInt() overrideReturns the current node’s value as an Int32.
int64_t get_ValueAsLong() overrideReturns the current node’s value as an Int64.
TypeInfo get_ValueType() overrideReturns the type of the current node.
virtual String get_XmlLang()Returns the xml:lang scope for the current node.
SharedPtr<System::Xml::Schema::XmlSchemaType> get_XmlType() overrideReturns the XmlSchemaType information for the current node.
virtual String GetAttribute(String, String)Returns the value of the attribute with the specified local name and namespace URI.
Detail::SmartPtrCounter * GetCounter()Gets reference counter data structure associated with the object.
virtual int32_t GetHashCode() constAnalog of C# Object.GetHashCode() method. Enables hashing of custom objects.
virtual String GetNamespace(String)Returns the value of the namespace node corresponding to the specified local name.
SharedPtr<Collections::Generic::IDictionary<String, String>> GetNamespacesInScope(XmlNamespaceScope) overrideReturns the in-scope namespaces of the current node.
virtual const TypeInfo& GetType() constGets actual type of object. Analog of C# System.Object.GetType() call.
virtual SharedPtr<XmlWriter> InsertAfter()Returns an XmlWriter object used to create a new sibling node after the currently selected node.
virtual void InsertAfter(String)Creates a new sibling node after the currently selected node using the XML string specified.
virtual void InsertAfter(SharedPtr<XmlReader>)Creates a new sibling node after the currently selected node using the XML contents of the XmlReader object specified.
virtual void InsertAfter(SharedPtr<XPathNavigator>)Creates a new sibling node after the currently selected node using the nodes in the XPathNavigator object specified.
virtual SharedPtr<XmlWriter> InsertBefore()Returns an XmlWriter object used to create a new sibling node before the currently selected node.
virtual void InsertBefore(String)Creates a new sibling node before the currently selected node using the XML string specified.
virtual void InsertBefore(SharedPtr<XmlReader>)Creates a new sibling node before the currently selected node using the XML contents of the XmlReader object specified.
virtual void InsertBefore(SharedPtr<XPathNavigator>)Creates a new sibling node before the currently selected node using the nodes in the XPathNavigator specified.
virtual void InsertElementAfter(String, String, String, String)Creates a new sibling element after the current node using the namespace prefix, local name and namespace URI specified, with the value specified.
virtual void InsertElementBefore(String, String, String, String)Creates a new sibling element before the current node using the namespace prefix, local name, and namespace URI specified, with the value specified.
virtual bool Is(const TypeInfo&) constCheck if object represents an instance of type described by targetType. Analog of C# ‘is’ operator.
virtual bool IsDescendant(SharedPtr<XPathNavigator>)Determines whether the specified XPathNavigator is a descendant of the current XPathNavigator.
virtual bool IsSamePosition(SharedPtr<XPathNavigator>)When overridden in a derived class, determines whether the current XPathNavigator is at the same position as the specified XPathNavigator.
void Lock()Implements C# lock() statement locking. Call directly or use LockContext sentry object.
String LookupNamespace(const String&) overrideReturns the namespace URI for the specified prefix.
String LookupPrefix(const String&) overrideReturns the prefix declared for the specified namespace URI.
virtual bool Matches(SharedPtr<XPathExpression>)Determines whether the current node matches the specified XPathExpression.
virtual bool Matches(String)Determines whether the current node matches the specified XPath expression.
virtual ptr MemberwiseClone() constAnalog of C# Object.MemberwiseClone() method. Enables cloning custom types.
virtual bool MoveTo(SharedPtr<XPathNavigator>)When overridden in a derived class, moves the XPathNavigator to the same position as the specified XPathNavigator.
virtual bool MoveToAttribute(String, String)Moves the XPathNavigator to the attribute with the matching local name and namespace URI.
virtual bool MoveToChild(String, String)Moves the XPathNavigator to the child node with the local name and namespace URI specified.
virtual bool MoveToChild(XPathNodeType)Moves the XPathNavigator to the child node of the XPathNodeType specified.
virtual bool MoveToFirst()Moves the XPathNavigator to the first sibling node of the current node.
virtual bool MoveToFirstAttribute()When overridden in a derived class, moves the XPathNavigator to the first attribute of the current node.
virtual bool MoveToFirstChild()When overridden in a derived class, moves the XPathNavigator to the first child node of the current node.
virtual bool MoveToFirstNamespace(XPathNamespaceScope)When overridden in a derived class, moves the XPathNavigator to the first namespace node that matches the XPathNamespaceScope specified.
bool MoveToFirstNamespace()Moves the XPathNavigator to first namespace node of the current node.
virtual bool MoveToFollowing(String, String)Moves the XPathNavigator to the element with the local name and namespace URI specified in document order.
virtual bool MoveToFollowing(String, String, SharedPtr<XPathNavigator>)Moves the XPathNavigator to the element with the local name and namespace URI specified, to the boundary specified, in document order.
virtual bool MoveToFollowing(XPathNodeType)Moves the XPathNavigator to the following element of the XPathNodeType specified in document order.
virtual bool MoveToFollowing(XPathNodeType, SharedPtr<XPathNavigator>)Moves the XPathNavigator to the following element of the XPathNodeType specified, to the boundary specified, in document order.
virtual bool MoveToId(String)When overridden in a derived class, moves to the node that has an attribute of type ID whose value matches the specified String.
virtual bool MoveToNamespace(String)Moves the XPathNavigator to the namespace node with the specified namespace prefix.
virtual bool MoveToNext()When overridden in a derived class, moves the XPathNavigator to the next sibling node of the current node.
virtual bool MoveToNext(String, String)Moves the XPathNavigator to the next sibling node with the local name and namespace URI specified.
virtual bool MoveToNext(XPathNodeType)Moves the XPathNavigator to the next sibling node of the current node that matches the XPathNodeType specified.
virtual bool MoveToNextAttribute()When overridden in a derived class, moves the XPathNavigator to the next attribute.
virtual bool MoveToNextNamespace(XPathNamespaceScope)When overridden in a derived class, moves the XPathNavigator to the next namespace node matching the XPathNamespaceScope specified.
bool MoveToNextNamespace()Moves the XPathNavigator to the next namespace node.
virtual bool MoveToParent()When overridden in a derived class, moves the XPathNavigator to the parent node of the current node.
virtual bool MoveToPrevious()When overridden in a derived class, moves the XPathNavigator to the previous sibling node of the current node.
virtual void MoveToRoot()Moves the XPathNavigator to the root node that the current node belongs to.
Object()Creates object. Initializes all internal data structures.
Object(Object const&)Copy constructor. Doesn’t copy anything, really, just initializes new object and enables copy constructing subclasses.
Object& operator=(Object const&)Assignment operator. Doesn’t copy anything, really, just initializes new object and enables copy constructing subclasses.
virtual SharedPtr<XmlWriter> PrependChild()Returns an XmlWriter object used to create a new child node at the beginning of the list of child nodes of the current node.
virtual void PrependChild(String)Creates a new child node at the beginning of the list of child nodes of the current node using the XML string specified.
virtual void PrependChild(SharedPtr<XmlReader>)Creates a new child node at the beginning of the list of child nodes of the current node using the XML contents of the XmlReader object specified.
virtual void PrependChild(SharedPtr<XPathNavigator>)Creates a new child node at the beginning of the list of child nodes of the current node using the nodes in the XPathNavigator object specified.
virtual void PrependChildElement(String, String, String, String)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.
virtual SharedPtr<XmlReader> ReadSubtree()Returns an XmlReader object that contains the current node and its child nodes.
static bool ReferenceEquals(ptr const&, ptr const&)Compares objects by reference.
static std::enable_if<!IsSmartPtr<T>::value, bool>::type ReferenceEquals(T const&, T const&)Compares objects by reference.
static std::enable_if<!IsSmartPtr<T>::value, bool>::type ReferenceEquals(T const&, std::nullptr_t)Reference-compares value type object with nullptr.
bool ReferenceEquals(String const&, std::nullptr_t)Specialization of Object::ReferenceEquals for case of string and nullptr.
bool ReferenceEquals(String const&, String const&)Specialization of Object::ReferenceEquals for case of strings.
int RemovedSharedRefs(int)Decreases shared reference count by specified value.
virtual SharedPtr<XmlWriter> ReplaceRange(SharedPtr<XPathNavigator>)Replaces a range of sibling nodes from the current node to the node specified.
virtual void ReplaceSelf(String)Replaces the current node with the content of the string specified.
virtual void ReplaceSelf(SharedPtr<XmlReader>)Replaces the current node with the contents of the XmlReader object specified.
virtual void ReplaceSelf(SharedPtr<XPathNavigator>)Replaces the current node with the contents of the XPathNavigator object specified.
virtual SharedPtr<XPathNodeIterator> Select(String)Selects a node set, using the specified XPath expression.
virtual SharedPtr<XPathNodeIterator> Select(String, SharedPtr<IXmlNamespaceResolver>)Selects a node set using the specified XPath expression with the IXmlNamespaceResolver object specified to resolve namespace prefixes.
virtual SharedPtr<XPathNodeIterator> Select(SharedPtr<XPathExpression>)Selects a node set using the specified XPathExpression.
virtual SharedPtr<XPathNodeIterator> SelectAncestors(XPathNodeType, bool)Selects all the ancestor nodes of the current node that have a matching XPathNodeType.
virtual SharedPtr<XPathNodeIterator> SelectAncestors(String, String, bool)Selects all the ancestor nodes of the current node that have the specified local name and namespace URI.
virtual SharedPtr<XPathNodeIterator> SelectChildren(XPathNodeType)Selects all the child nodes of the current node that have the matching XPathNodeType.
virtual SharedPtr<XPathNodeIterator> SelectChildren(String, String)Selects all the child nodes of the current node that have the local name and namespace URI specified.
virtual SharedPtr<XPathNodeIterator> SelectDescendants(XPathNodeType, bool)Selects all the descendant nodes of the current node that have a matching XPathNodeType.
virtual SharedPtr<XPathNodeIterator> SelectDescendants(String, String, bool)Selects all the descendant nodes of the current node with the local name and namespace URI specified.
virtual SharedPtr<XPathNavigator> SelectSingleNode(String)Selects a single node in the XPathNavigator using the specified XPath query.
virtual SharedPtr<XPathNavigator> SelectSingleNode(String, SharedPtr<IXmlNamespaceResolver>)Selects a single node in the XPathNavigator object using the specified XPath query with the IXmlNamespaceResolver object specified to resolve namespace prefixes.
virtual SharedPtr<XPathNavigator> SelectSingleNode(SharedPtr<XPathExpression>)Selects a single node in the XPathNavigator using the specified XPathExpression object.
virtual void set_InnerXml(String)Sets the markup representing the child nodes of the current node.
virtual void set_OuterXml(String)Sets the markup representing the opening and closing tags of the current node and its child nodes.
virtual void SetTemplateWeakPtr(uint32_t)Set n’th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode.
virtual void SetTypedValue(SharedPtr<Object>)Sets the typed value of the current node.
virtual void SetValue(String)Sets the value of the current node.
int SharedCount() constGets current value of shared reference counter.
Object * SharedRefAdded()Increments shared reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
int SharedRefRemovedSafe()Decrements and returns shared reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
String ToString() const overrideReturns the text value of the current node.
static const TypeInfo& Type()Implements C# typeof(System.Object) construct.
void Unlock()Implements C# lock() statement unlocking. Call directly or use LockContext sentry object.
SharedPtr<Object> ValueAs(const TypeInfo&, SharedPtr<IXmlNamespaceResolver>) overrideReturns the current node’s value as the Type specified, using the IXmlNamespaceResolver object specified to resolve namespace prefixes.
virtual SharedPtr<Object> ValueAs(const TypeInfo&)Returns the item’s value as the specified type.
Detail::SmartPtrCounter * WeakRefAdded()Increments weak reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
void WeakRefRemoved()Decrements weak reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
virtual void WriteSubtree(SharedPtr<XmlWriter>)Streams the current node and its child nodes to the XmlWriter object specified.
virtual ~Object()Destroys object. Frees all internal data structures.

Typedefs

TypedefDescription
PtrAn alias for shared pointer to an instance of this class.

See Also