XML/Input: Difference between revisions

Line 1,933:
alert(output);
</syntaxhighlight>
 
=={{header|jq}}==
Neither the C nor the Go implementations of jq natively support XML,
so in this entry we first use `xq`, a jq "wrapper", and second
a third-party XML-to-JSON translator, `knead`.
 
===xq===
xq is part of the python-yq package [https://github.com/kislyuk/yq].
<syntaxhighlight lang=jq>
xq -r '.Students.Student[]."@Name"' students.xml
</syntaxhighlight>
{{output}}
<pre>
April
Bob
Chad
Dave
Émily
</pre>
 
===knead | jq===
`knead` is part of the `dataknead` package at https://hay.github.io/dataknead/
<pre>
knead students.xml | jq -r '.Students.Student[]["@Name"]'
</pre>
{{Output}}
As above.
 
 
=={{header|Julia}}==
2,482

edits