Class NavigableNavigator
Provides a cursor model for navigating Umbraco data as if it were XML.
Inheritance
Namespace: Umbraco.Cms.Core.Xml.XPath
Assembly: Umbraco.Core.dll
Syntax
public class NavigableNavigator : XPathNavigator, ICloneable, IXmlNamespaceResolver, IXPathNavigable
Constructors
View SourceNavigableNavigator(INavigableSource, Int32, Int32)
Initializes a new instance of the NavigableNavigator class with a content source, and an optional root content.
Declaration
public NavigableNavigator(INavigableSource source, int rootId = 0, int maxDepth = 2147483647)
Parameters
Type | Name | Description |
---|---|---|
INavigableSource | source | The content source. |
System.Int32 | rootId | The root content identifier. |
System.Int32 | maxDepth | The maximum depth. |
Remarks
When no root content is supplied then the root of the source is used.
Properties
View SourceBaseURI
Gets the base URI for the current node.
Declaration
public override string BaseURI { get; }
Property Value
Type | Description |
---|---|
System.String |
InternalState
Declaration
public NavigableNavigator.State InternalState { get; }
Property Value
Type | Description |
---|---|
NavigableNavigator.State |
IsEmptyElement
Gets a value indicating whether the current node is an empty element without an end element tag.
Declaration
public override bool IsEmptyElement { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
LocalName
Gets the Name of the current node without any namespace prefix.
Declaration
public override string LocalName { get; }
Property Value
Type | Description |
---|---|
System.String |
Name
Gets the qualified name of the current node.
Declaration
public override string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
NamespaceURI
Gets the namespace URI of the current node.
Declaration
public override string NamespaceURI { get; }
Property Value
Type | Description |
---|---|
System.String |
NameTable
Gets the XmlNameTable of the XPathNavigator.
Declaration
public override XmlNameTable NameTable { get; }
Property Value
Type | Description |
---|---|
System.Xml.XmlNameTable |
NodeType
Gets the XPathNodeType of the current node.
Declaration
public override XPathNodeType NodeType { get; }
Property Value
Type | Description |
---|---|
System.Xml.XPath.XPathNodeType |
Prefix
Gets the namespace prefix associated with the current node.
Declaration
public override string Prefix { get; }
Property Value
Type | Description |
---|---|
System.String |
UnderlyingObject
Gets the underlying content object.
Declaration
public override object UnderlyingObject { get; }
Property Value
Type | Description |
---|---|
System.Object |
Value
Gets the string value of the item.
Declaration
public override string Value { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Does not fully behave as per the specs, as we report empty value on content elements, and we start reporting values only on property elements. This is because, otherwise, we would dump the whole database and it probably does not make sense at Umbraco level.
Methods
View SourceClone()
Creates a new XPathNavigator positioned at the same node as this XPathNavigator.
Declaration
public override XPathNavigator Clone()
Returns
Type | Description |
---|---|
System.Xml.XPath.XPathNavigator | A new XPathNavigator positioned at the same node as this XPathNavigator. |
CloneWithNewRoot(Int32, Int32)
Creates a new XPathNavigator using the same source but positioned at a new root.
Declaration
public XPathNavigator CloneWithNewRoot(int id, int maxDepth = 2147483647)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | |
System.Int32 | maxDepth |
Returns
Type | Description |
---|---|
System.Xml.XPath.XPathNavigator | A new XPathNavigator using the same source and positioned at a new root. |
Remarks
The new root can be above this navigator's root.
CloneWithNewRoot(String, Int32)
Creates a new XPathNavigator using the same source but positioned at a new root.
Declaration
public XPathNavigator CloneWithNewRoot(string id, int maxDepth = 2147483647)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | |
System.Int32 | maxDepth |
Returns
Type | Description |
---|---|
System.Xml.XPath.XPathNavigator | A new XPathNavigator using the same source and positioned at a new root. |
Remarks
The new root can be above this navigator's root.
IsSamePosition(XPathNavigator)
Determines whether the current XPathNavigator is at the same position as the specified XPathNavigator.
Declaration
public override bool IsSamePosition(XPathNavigator nav)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XPath.XPathNavigator | nav | The XPathNavigator to compare to this XPathNavigator. |
Returns
Type | Description |
---|---|
System.Boolean | true if the two XPathNavigator objects have the same position; otherwise, false. |
MoveTo(XPathNavigator)
Moves the XPathNavigator to the same position as the specified XPathNavigator.
Declaration
public override bool MoveTo(XPathNavigator nav)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XPath.XPathNavigator | nav | The XPathNavigator positioned on the node that you want to move to. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the XPathNavigator is successful moving to the same position as the specified XPathNavigator; otherwise, false. If false, the position of the XPathNavigator is unchanged. |
MoveToFirstAttribute()
Moves the XPathNavigator to the first attribute of the current node.
Declaration
public override bool MoveToFirstAttribute()
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the XPathNavigator is successful moving to the first attribute of the current node; otherwise, false. If false, the position of the XPathNavigator is unchanged. |
MoveToFirstChild()
Moves the XPathNavigator to the first child node of the current node.
Declaration
public override bool MoveToFirstChild()
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the XPathNavigator is successful moving to the first child node of the current node; otherwise, false. If false, the position of the XPathNavigator is unchanged. |
MoveToFirstNamespace(XPathNamespaceScope)
Moves the XPathNavigator to the first namespace node that matches the XPathNamespaceScope specified.
Declaration
public override bool MoveToFirstNamespace(XPathNamespaceScope namespaceScope)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XPath.XPathNamespaceScope | namespaceScope | An XPathNamespaceScope value describing the namespace scope. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the XPathNavigator is successful moving to the first namespace node; otherwise, false. If false, the position of the XPathNavigator is unchanged. |
MoveToId(String)
Moves to the node that has an attribute of type ID whose value matches the specified String.
Declaration
public override bool MoveToId(string id)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | A String representing the ID value of the node to which you want to move. |
Returns
Type | Description |
---|---|
System.Boolean | true if the XPathNavigator is successful moving; otherwise, false. If false, the position of the navigator is unchanged. |
MoveToNext()
Moves the XPathNavigator to the next sibling node of the current node.
Declaration
public override bool MoveToNext()
Returns
Type | Description |
---|---|
System.Boolean | true if the XPathNavigator is successful moving to the next sibling node; otherwise, false if there are no more siblings or if the XPathNavigator is currently positioned on an attribute node. If false, the position of the XPathNavigator is unchanged. |
MoveToNextAttribute()
Moves the XPathNavigator to the next attribute.
Declaration
public override bool MoveToNextAttribute()
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the XPathNavigator is successful moving to the next attribute; false if there are no more attributes. If false, the position of the XPathNavigator is unchanged. |
MoveToNextNamespace(XPathNamespaceScope)
Moves the XPathNavigator to the next namespace node matching the XPathNamespaceScope specified.
Declaration
public override bool MoveToNextNamespace(XPathNamespaceScope namespaceScope)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XPath.XPathNamespaceScope | namespaceScope | An XPathNamespaceScope value describing the namespace scope. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the XPathNavigator is successful moving to the next namespace node; otherwise, false. If false, the position of the XPathNavigator is unchanged. |
MoveToParent()
Moves the XPathNavigator to the parent node of the current node.
Declaration
public override bool MoveToParent()
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the XPathNavigator is successful moving to the parent node of the current node; otherwise, false. If false, the position of the XPathNavigator is unchanged. |
MoveToPrevious()
Moves the XPathNavigator to the previous sibling node of the current node.
Declaration
public override bool MoveToPrevious()
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the XPathNavigator is successful moving to the previous sibling node; otherwise, false if there is no previous sibling node or if the XPathNavigator is currently positioned on an attribute node. If false, the position of the XPathNavigator is unchanged. |
MoveToRoot()
Moves the XPathNavigator to the root node that the current node belongs to.
Declaration
public override void MoveToRoot()