XmlPeekAliases.

XmlPeek(ICakeContext, FilePath, string) Method

Summary

Gets the value of a target node.
Namespace
Cake.Common.Xml
Containing Type
XmlPeekAliases

Syntax

[CakeMethodAlias]
public static string XmlPeek(this ICakeContext context, FilePath filePath, string xpath)

Examples

string autoFacVersion = XmlPeek("./src/Cake/packages.config", "/packages/package[@id='Autofac']/@version");

Attributes

Type Description
CakeMethodAliasAttribute An attribute used to mark script method aliases.

Parameters

Name Type Description
context ICakeContext The context.
filePath FilePath The target file.
xpath string The xpath of the node to get.

Return Value

Type Description
string The value found at the given XPath query.