# Creating xpath for dynamic search of node by name

**URL:** <https://community.bloomreach.com/t/creating-xpath-for-dynamic-search-of-node-by-name/4375>\
**Category:** Uncategorized\
**Created:** [April 18, 2024, 7:36am UTC](https://community.bloomreach.com/t/creating-xpath-for-dynamic-search-of-node-by-name/4375 "2024-04-18T07:36:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Petra](https://avatars.discourse-cdn.com/v4/letter/p/94ad74/32.png) [@Petra](https://community.bloomreach.com/u/Petra)\
**Post date:** [April 18, 2024, 7:36am UTC](https://community.bloomreach.com/t/creating-xpath-for-dynamic-search-of-node-by-name/4375/1 "2024-04-18T07:36:45Z")

</div>

Hello dear bloomreach comunity colleagues, once again from my side. I have a node with a name. The node with this name can be placed in different subranches under hst:host. I want to detect and get all the nodes with this name. I know it is possible to search for nodes by primary type, by uuid, also other properties, but is there any way to look dynamically for nodes with a given name without having to know where exactly there are placed?

---

<div class="post-metadata">

**Author:** ![jasper.floor](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/jasper.floor/32/28_2.png) [@jasper.floor](https://community.bloomreach.com/u/jasper.floor)\
**Post date:** [April 18, 2024, 9:30am UTC](https://community.bloomreach.com/t/creating-xpath-for-dynamic-search-of-node-by-name/4375/2 "2024-04-18T09:30:55Z")

</div>

Hi,

you can search like:

```auto
//nodeName

```

But the node name itself must be an exact match. No wildcards or comparison operators are possible on node names.

You can also be more specific:

```auto
//content/documents//nodeName

```

the // means search all nodes underneath this path. I may have gone overboard with the // but this will work. Technically you could /content/documents//nodeName, but I’ve had some issues in the past that makes me overuse the syntax.

---

<div class="post-metadata">

**Author:** ![Petra](https://avatars.discourse-cdn.com/v4/letter/p/94ad74/32.png) [@Petra](https://community.bloomreach.com/u/Petra)\
**Post date:** [April 18, 2024, 10:05am UTC](https://community.bloomreach.com/t/creating-xpath-for-dynamic-search-of-node-by-name/4375/3 "2024-04-18T10:05:27Z")

</div>

Hi @jasper.floor, thank you very much for your answer. This is great and will help me. The “//” means a recursive search under a given path? Yes, I was trying it with wildcards, had no success and it is as simple as I see here. Thank you so much.

---

<div class="post-metadata">

**Author:** ![jasper.floor](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/jasper.floor/32/28_2.png) [@jasper.floor](https://community.bloomreach.com/u/jasper.floor)\
**Post date:** [April 18, 2024, 10:06am UTC](https://community.bloomreach.com/t/creating-xpath-for-dynamic-search-of-node-by-name/4375/4 "2024-04-18T10:06:33Z")

</div>

Yes, // means recursive search under a path. Glad to help, good luck!
