Class MacroNavigator
Provides a cursor model for navigating {macro /} as if it were XML.
Inheritance
Namespace: Umbraco.Cms.Core.Xml.XPath
Assembly: Umbraco.Core.dll
Syntax
public class MacroNavigator : XPathNavigator, ICloneable, IXmlNamespaceResolver, IXPathNavigable
Constructors
View SourceMacroNavigator(IEnumerable<MacroNavigator.MacroParameter>)
Initializes a new instance of the MacroNavigator class with macro parameters.
Declaration
public MacroNavigator(IEnumerable<MacroNavigator.MacroParameter> parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<MacroNavigator.MacroParameter> | parameters | The macro parameters. |
Properties
View SourceBaseURI
Gets the base URI for the current node.
Declaration
public override string BaseURI { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
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 |
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 root and macro elements, and we start reporting values only on parameter elements. This is because, otherwise, we would might 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. |
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()