Skip to content

gkawamoto/xmlq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

xmlq

xmlq is a tool to query a XML document using XPath. It is written in Go and uses github.com/antchfx/xmlquery to parse the XML and query it using XPath.

For information on XPath support, see the documentation of the underlying github.com/antchfx/xpath lib.

Installation

$ go install github.com/gkawamoto/xmlq@main

Usage

$ xmlq -h
Usage of xmlq:
  -p	pretty print
  -t	inner text

Examples

Fetching a value from a path

$ echo "<payload><key>value</key></payload>" | xmlq -t '/payload/key'
value

Formatting a XML

$ echo "<payload><key>value</key></payload>" | xmlq -p

<?xml version="1.0"?>
<payload>
  <key>value</key>
</payload>

Contributing

Push your changes to a branch and open a pull request.

About

XPath your way into XML files

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages