XMLStarlet: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 19: Line 19:
==<tt>sel</tt>==
==<tt>sel</tt>==
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.
xml sel -t <template options> <xml-file-name>
===<tt>sel</tt> Options===
===<tt>sel</tt> Options===
====<tt>-t</tt>====
====<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>


====<tt>-c</tt>====
====<tt>-c</tt>====

Revision as of 02:16, 1 July 2021

External

Internal

Overview

XMLStartlet ships with one executable called xml, which can be used as the short form of the xmlstarlet command.

XPath Syntax

XPath Syntax

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.

sel Options

-t

Create an XSLT template using the provided options.

xml sel -t <template options> <xml-file-name>

-c

-v

ed

Edit an XML file.

tr

Transform an XML file using XSLT.