XMLStarlet: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 15: | Line 15: | ||
xml [[[#General_Options|options]]] <[[#Commands|command]]> [command options] | xml [[[#General_Options|options]]] <[[#Commands|command]]> [command options] | ||
=<tt>sel</tt> Command= | |||
Select (query) an XML file using XPath. It can also generate an [[XSLT#Overview|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#Overview|XSLT]] document. Internally, when <code>sel</code> command is used, the tool converts internally the commands into an XSLT to perform the query. | ||
==<tt>sel</tt> Options== | |||
===<tt>-t</tt>=== | |||
Create an [[XSLT#XSLT_Template|XSLT template]] using the provided options. | Create an [[XSLT#XSLT_Template|XSLT template]] using the provided options. | ||
xml sel -t <template options> <xml-file-name> | xml sel -t <template options> <xml-file-name> | ||
===<tt>-c</tt>=== | |||
===<tt>-v</tt>=== | |||
=<tt>ed</tt> Command= | |||
Edit an XML file. | Edit an XML file. | ||
=<tt>tr</tt> Command= | |||
Transform an XML file using [[XSLT]]. | Transform an XML file using [[XSLT]]. | ||
=General Options= | =General Options= |
Revision as of 02:19, 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.
XPath Syntax
Usage
xml [options] <command> [command options]
sel Command
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.
sel Options
-t
Create an XSLT template using the provided options.
xml sel -t <template options> <xml-file-name>
-c
-v
ed Command
Edit an XML file.
tr Command
Transform an XML file using XSLT.