# XPath 搜索

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/zh-cn/help/go/llms.txt).

GoLand 允许您使用 XPath 3.0 在当前项目、目录或自定义范围内的 XML 文件中查找特定的 XML 节点。

在撰写 XPath 表达式时，GoLand会为 XPath axes 提供代码补全并检查表达式语法。 它还提供了 XPath 语法高亮显示，可以在  `设置 | 编辑器 | 颜色方案 | XPath`  中自定义。

Procedure: 在 XML 文件中搜索

1. 在主菜单中，进入  `编辑 | 查找 | 通过 XPath 查找…` .   通过 XPath 表达式查找  对话框打开。

2. 输入 XPath 表达式。

例如，下列表达式：

```XSD
//application[@title="BestApp"]/descendant::resource

```

将搜索  `resource`  标签，该标签是具有  `application`  标签的子元素，并且该标签具有值为  `BestApp`  的属性  `title` 。

3. 选择搜索范围。

如果您选择   目录   并指定目录路径，您还可以选择   递归地   复选框以搜索所有子目录中的节点。

XPath 搜索结果显示在 [Find](find-tool-window.html) 工具窗口中。

