π
π
π
π
Dasel
Searchβ¦
π
π
π
π
Dasel
Introduction
Installation
Use as a go package
Github
Playground
Usage
Select
Put
Put object
Put document
Delete
Flags
Supported file types
Selectors
Introduction
Property
Keys and indexes
Index
Next Available Index
All indexes
Dynamic
Search
Length
Type
Notes
File formatting and ordering
Memory usage
Converting between formats
Examples
JQ to Dasel
YQ to Dasel
XML
Filter JSON API results
Powered By
GitBook
XML
XML has some slight differences (such as attributes) that should be documented.
See
XML file format
for more information.
Query attributes
Decoded attributes are set as properties on the related object with a prefix of
-
.
1
echo
'<data>
2
<users primary="true">
3
<name>Tom</name>
4
</users>
5
<users primary="false">
6
<name>Frank</name>
7
</users>
8
</data>'
|
dasel -p xml
'.data.users[0].-primary'
9
true
Copied!
Filtering on attributes
We can also filter on attributes since they are defined against the related object.
1
echo
'<data>
2
<users primary="true">
3
<name>Tom</name>
4
</users>
5
<users primary="false">
6
<name>Frank</name>
7
</users>
8
</data>'
|
dasel -p xml
'.data.users.(-primary=true).name'
9
Tom
Copied!
Examples - Previous
YQ to Dasel
Next - Examples
Filter JSON API results
Last modified
1yr ago
Copy link
Contents
Query attributes
Filtering on attributes