Skip to content

Commit 6eb193b

Browse files
committed
xml: add documentation for parent and root()
1 parent 3ebafae commit 6eb193b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/xml/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,22 @@ days.find(day => day.attrs.idx === 0)
109109
days.filter(day => day.attrs.idx > 2)
110110
```
111111

112+
### parent
113+
114+
You can get the parent node using the parent property.
115+
116+
```js
117+
console.log(message.getChild('days').parent === message)
118+
```
119+
120+
### root
121+
122+
You can get the root node using the root method.
123+
124+
```js
125+
console.log(message.getChild('days').root() === message)
126+
```
127+
112128
## Editing
113129

114130
### attributes

0 commit comments

Comments
 (0)