Class UmbracoXPathPathSyntaxParser
This is used to parse our customize Umbraco XPath expressions (i.e. that include special tokens like $site) into a real XPath statement
Inheritance
System.Object
Namespace: Umbraco.Cms.Core.Xml
Assembly: Umbraco.Core.dll
Syntax
public class UmbracoXPathPathSyntaxParser
Methods
View SourceParseXPathQuery(String, Nullable<Int32>, Func<Int32, Nullable<IEnumerable<String>>>, Func<Int32, Boolean>)
Declaration
public static string ParseXPathQuery(string xpathExpression, int? nodeContextId, Func<int, IEnumerable<string>?> getPath, Func<int, bool> publishedContentExists)
Parameters
Type | Name | Description |
---|---|---|
System.String | xpathExpression | |
System.Nullable<System.Int32> | nodeContextId | |
Func<System.Int32, System.Nullable<IEnumerable<System.String>>> | getPath | |
Func<System.Int32, System.Boolean> | publishedContentExists |
Returns
Type | Description |
---|---|
System.String |
ParseXPathQuery(String, Nullable<Int32>, Nullable<Int32>, Func<Int32, Nullable<IEnumerable<String>>>, Func<Int32, Boolean>)
Parses custom umbraco xpath expression
Declaration
public static string ParseXPathQuery(string xpathExpression, int? nodeContextId, int? parentId, Func<int, IEnumerable<string>?> getPath, Func<int, bool> publishedContentExists)
Parameters
Type | Name | Description |
---|---|---|
System.String | xpathExpression | The Xpath expression |
System.Nullable<System.Int32> | nodeContextId | The current node id context of executing the query - null if there is no current node. |
System.Nullable<System.Int32> | parentId | The parent node id of the current node id context of executing the query. With this we can determine the $parent and $site parameters even if the current node is not yet published. |
Func<System.Int32, System.Nullable<IEnumerable<System.String>>> | getPath | The callback to create the nodeId path, given a node Id |
Func<System.Int32, System.Boolean> | publishedContentExists | The callback to return whether a published node exists based on Id |
Returns
Type | Description |
---|---|
System.String |