xml2
« Back to VersTracker
Description:
Makes XML and HTML more amenable to classic UNIX text tools
Type: Formula  |  Tracked Since: Nov 13, 2024
Links: Homepage  |  formulae.brew.sh
Category: System utilities
Tags: xml html text-processing unix cli parser
Install: brew install xml2
About:
xml2 is a command-line utility that converts XML and HTML documents into a flat, line-oriented format suitable for processing with standard UNIX text tools like grep, sed, and awk. It parses the document's structure and outputs element attributes and text content on separate lines, enabling powerful text-based manipulation. Its main value is bridging the gap between structured markup languages and the classic UNIX text-processing philosophy.
Key Features:
  • Converts XML/HTML to a flat, line-oriented text format
  • Enables use of grep, sed, awk, and other UNIX text tools on XML/HTML
  • Simple command-line interface for easy scripting and pipelining
  • Outputs element attributes and text content on separate, parseable lines
Use Cases:
  • Extracting specific data or attributes from large XML configuration files
  • Performing search-and-replace or other text transformations on HTML/XML documents within a shell pipeline
Alternatives:
  • xmlstarlet – A more full-featured toolkit for XML querying, editing, and transformation, whereas xml2 is focused purely on conversion to flat text.
  • xqilla – An XQuery and XPath processor for complex XML querying, while xml2 provides simpler, text-tool-friendly output.
Version History
Detected Version Rev Change Commit
Nov 13, 2024 9:07am 0 VERSION_BUMP cfd2927b