xml

xml maps XML into an addressable tree: elements use dotted paths, attributes use @name, and element text can be addressed as #text.

DataVersion 1.1.5Stable
lil-terminal

Overview

xml gives XML files the same focused workflow: inspect element and attribute paths, search keys or values, change one node atomically, validate the document, and dump normalized XML when the complete source matters.

Elements, attributes and text are different nodes

config.@env and config.application.name select different kinds of XML data. The command gives simple XML a compact path model without pretending to replace XPath or a full XML editor; PHP DOM is required.

Syntax

lil-terminal
xml <file> [key|options] · xml dump <file>

Reference

xml <file>

show XML data

xml <file> <key>

show one exact path or value

xml dump <file>

show normalized source text

-f <text|mask> [-k|-v]

find matching keys, paths or values

-w <key> : <value>

write a value directly to the file

-w <key> < <file>

write a value read from another file

-d <key>

delete a value or path

-c

validate the file

Active file

With the current core, a successfully opened file is immediately available as $. If this module is the highest-priority installed handler for the file extension, typing the filename by itself opens it through this command. These are core conveniences; xml <file> remains the explicit form.

Search

-f searches paths and values. Add -k for keys only or -v for values only. Queries containing * or ? are treated as masks.

Direct editing

-w writes immediately to the file. Use : for an inline value or < <file> to read a value from another file. -d deletes one dotted path.

Interactive sandbox preview

Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.

Open the file and reuse it with $

Install and manage

Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.

Base and Minimum are two packages of the same current module release, not separate command versions.

Base package

Install the complete package with local command reference and every published mode.

install xml
Minimum package

Install the reduced package. Local reference is omitted; help <cmd> -i opens the current server reference.

install xml -m
Exact public version

Install exactly this published version.

install xml -v 1.1.5
Check or update

Ask upgrade to check compatibility and replace the installed block only when needed.

upgrade xml
Remove module

Remove the extension block while leaving the core and unrelated modules intact.

install xml -u

Examples

Examples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.

Open the file and reuse it with $
cd \sandbox\config | xml app.xml
config.@env              production
config.application.name  lil-shop
config.application.debug true
config.database.host     localhost
config.database.port     3306
Show XML data
app.xml
config.@env              production
config.application.name  lil-shop
config.application.debug true
config.database.host     localhost
config.database.port     3306
Show one exact path or value
xml $ config.application.name
lil-shop
Show one exact path or value
xml $ config.@env
production
Xml · find-key
xml $ -f "host" -k
config.database.host  localhost
Xml · find-value
xml $ -f "localhost" -v
config.database.host  localhost
Xml · write
xml $ -w config.database.port : 3307
config.database.port  3307
Xml · delete
xml $ -d config.application.debug
config.application.name  lil-shop
config.database.host     localhost
Xml · validate
xml $ -c
Valid XML
Show normalized source text
xml dump $
<?xml version="1.0" encoding="UTF-8"?>
<config env="production">…</config>
Handle a missing file
xml \sandbox\config\missing.xml
File not found

File used in this example: sandbox/config/app.xml

The example uses a file or directory from the protected /sandbox/ documentation workspace.

<?xml version="1.0" encoding="UTF-8"?>
<config env="production">
  <application><name>lil-shop</name><debug>true</debug></application>
  <database><host>localhost</host><port>3306</port></database>
</config>

Related documentation

Current public release

v1.1.52026-08-14

Standardized structured-data help

Simplifies the XML overview and groups search, write, delete and validation operations as flags.