← 返回命令列表

Linux command

xml-list 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

List all elements

xml el [file.xml]

Show elements with attributes

xml el -a [file.xml]

Show elements with attributes and values

xml el -v [file.xml]

Show unique element paths

xml el -u [file.xml]

说明

xml el (also accepted as xml elements / xml list) prints the element structure of an XML document as XPath-like paths, one per line. It is part of the xmlstarlet toolkit. Useful for quickly exploring unfamiliar XML files, producing summaries of element hierarchies, or generating templates for xml sel queries.

参数

-a
Show attributes of each element.
-v
Show attributes and values.
-u
Show only unique element paths.

FAQ

What is the xml-list command used for?

xml el (also accepted as xml elements / xml list) prints the element structure of an XML document as XPath-like paths, one per line. It is part of the xmlstarlet toolkit. Useful for quickly exploring unfamiliar XML files, producing summaries of element hierarchies, or generating templates for xml sel queries.

How do I run a basic xml-list example?

Run `xml el [file.xml]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a do in xml-list?

Show attributes of each element.