yq: "Working with XML" documentation example does not work for version 4.17.2

Describe the bug Trying “Parse xml: simple” from top of this page https://mikefarah.gitbook.io/yq/usage/xml

Version of yq: 4.17.2 $ yq --version yq (https://github.com/mikefarah/yq/) version 4.17.2

Operating system: Ubuntu 20.04.3 LTS Installed via: snap $ snap list |grep yq yq 4.17.2 1557 latest/stable mikefarah

Input XML test.xml:

<?xml version="1.0" encoding="UTF-8"?>
<cat>
  <says>meow</says>
  <legs>4</legs>
  <cute>true</cute>
</cat>

Command The command you ran:

yq -p=xml "." test.xml

Actual behavior

Error: unknown command “.” for “yq” Run ‘yq --help’ for usage.

Expected behavior

cat:
  says: meow
  legs: "4"
  cute: "true"

Additional context no

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

Fixed STD bug in 4.20.1