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.6Stable
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

How to use it

Start with xml config/app.xml to list paths, then read one value by appending its dotted path. -f searches keys and values; -k restricts it to paths and -v to values. -c checks XML syntax; dump displays normalized XML. In Base, -w <key> : <value> changes a value, < <file> takes it from a file, and -d <key> removes a node. Make a backup first.

Limits and safety

This is a structured editor, not an XML source-preserving editor. Rewriting may discard comments, namespaces, mixed-content details and original spacing or sibling order. External entities and DTDs are rejected. The PHP DOM extension is required, and Minimum only displays the whole file. Use edit or code when exact XML markup matters.

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.6
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 $
xml config/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/app.xml config.application.name
lil-shop
Show one exact path or value
xml config/app.xml config.@env
production
Show one exact path or value
xml config/app.xml config.database.port
3306
Find matching keys, paths or values
xml config/app.xml -f "config.database.*" -k
config.database.host  localhost
config.database.port  3306
Find matching keys, paths or values
xml config/app.xml -f "localhost" -v
config.database.host  localhost
Find matching keys, paths or values
xml config/app.xml -f "debug"
config.application.debug  true
Write a value directly to the file
xml config/app.xml -w config.database.port : 3307
config.database.port  3307
Write a value read from another file
xml config/app.xml -w config.application.name < config/from-value.txt
config.application.name  new-shop
Delete a value or path
xml config/app.xml -d config.application.debug
config.@env              production
config.application.name  lil-shop
config.database.host     localhost
config.database.port     3306
Handle a missing file
xml config/app.xml -c
Valid XML
Show normalized source text
xml dump config/app.xml
<?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>
Show one exact path or value
xml config/app.xml unknown.key
Path not found
Validate the file
xml config/invalid.xml -c
Invalid XML
Show XML data
xml config/missing.xml
File not found
Write a value directly to the file
xml config/app.xml -w config.database.port
Value required after : or <
Delete a value or path
xml config/app.xml -d config
XML data must have exactly one root element
Write a value directly to the file
xml config/app.xml -w config.missing.child : 5
Parent path is not a collection

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.62026-11-01

Production refinement

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