XML/Input: Difference between revisions
Content added Content deleted
Line 1,933: | Line 1,933: | ||
alert(output); |
alert(output); |
||
</syntaxhighlight> |
</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}}== |
=={{header|Julia}}== |