Skip to content

Commit 139b93b

Browse files
feat: Improved explanation for direct children expressions. Closes #105
1 parent 343df7f commit 139b93b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docs/tutorials/3.1/usingthymeleaf.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6050,11 +6050,14 @@ read on to know why):
60506050
<div th:insert="~{mytemplate :: //div[@class='content']}">...</div>
60516051
```
60526052
6053+
All selector expressions are absolute, i.e. computed from the root of the template being
6054+
selected in the left side of the `::`, even if this is the _current_ template.
6055+
60536056
The basic syntax includes:
60546057
6055-
* `/x` means direct children of the current node with name x.
6058+
* `n/x` means direct children of `n` with name x. If `/x`, then direct children of the root.
60566059
6057-
* `//x` means children of the current node with name x, at any depth.
6060+
* `n//x` means children of `n` with name x, at any depth. If `//x`, then computed from the root.
60586061

60596062
* `x[@z="v"]` means elements with name x and an attribute called z with value
60606063
"v".

0 commit comments

Comments
 (0)