XMLStarlet: Difference between revisions
Jump to navigation
Jump to search
Line 12: | Line 12: | ||
==General Options== | ==General Options== | ||
=Commands= | |||
==<tt>sel</tt>== | |||
Select (query) an XML file using XPath. It can also generate an XSLT document. Internally, when <code>sel</code> command is used, the tool converts internally the commands into an XSLT to perform the query. | Select (query) an XML file using XPath. It can also generate an XSLT document. Internally, when <code>sel</code> command is used, the tool converts internally the commands into an XSLT to perform the query. | ||
xml set -t <template options> <xml-file-name> | xml set -t <template options> <xml-file-name> | ||
===<tt>sel</tt> Options=== | |||
====<tt>-t</tt>==== | |||
====<tt>-c</tt>==== | |||
====<tt>-v</tt>==== | |||
==<tt>ed</tt>== | |||
Edit an XML file. | Edit an XML file. | ||
==<tt>tr</tt>== | |||
Transform an XML file using XSLT. | Transform an XML file using XSLT. | ||
=XPath Syntax= | =XPath Syntax= | ||
{{Internal|XPath#Syntax|XPath Syntax}} | {{Internal|XPath#Syntax|XPath Syntax}} |
Revision as of 02:12, 1 July 2021
External
- https://www.baeldung.com/linux/evaluate-xpath#using-the-xmlstarlet-toolkit
- http://xmlstar.sourceforge.net/
Internal
Overview
XMLStartlet ships with one executable called xml
, which can be used as the short form of the xmlstarlet
command.
Usage
xml [options] <command> [command options]
General Options
Commands
sel
Select (query) an XML file using XPath. It can also generate an XSLT document. Internally, when sel
command is used, the tool converts internally the commands into an XSLT to perform the query.
xml set -t <template options> <xml-file-name>
sel Options
-t
-c
-v
ed
Edit an XML file.
tr
Transform an XML file using XSLT.