{"id":15663114,"url":"https://github.com/fralau/xmlshow","last_synced_at":"2025-05-06T06:36:29.970Z","repository":{"id":44930588,"uuid":"125232169","full_name":"fralau/xmlshow","owner":"fralau","description":"Settle for LESS: a fast and super-simple XML viewer for command-line","archived":false,"fork":false,"pushed_at":"2018-03-15T08:25:42.000Z","size":483,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T01:22:27.322Z","etag":null,"topics":["bash-script","large-files","syntax-highlighting","unix-command","viewer","xml"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fralau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-14T15:14:27.000Z","updated_at":"2025-03-29T16:07:16.000Z","dependencies_parsed_at":"2022-08-25T13:22:38.077Z","dependency_job_id":null,"html_url":"https://github.com/fralau/xmlshow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fralau%2Fxmlshow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fralau%2Fxmlshow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fralau%2Fxmlshow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fralau%2Fxmlshow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fralau","download_url":"https://codeload.github.com/fralau/xmlshow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252634172,"owners_count":21779990,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash-script","large-files","syntax-highlighting","unix-command","viewer","xml"],"created_at":"2024-10-03T13:35:31.893Z","updated_at":"2025-05-06T06:36:29.910Z","avatar_url":"https://github.com/fralau.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xmlshow: A super-simple and powerful viewer for large XML files, for the command-line\n\n## Introduction\n\nEver found yourself with an XML file just too large for your editor or your browser, and did you (like me) spent your time trying to find a simple solution on the Web? This one may be for you.\n\nAnd if it isn't, you may have found enough material to create your own, just with standard utilities.\n\n### Features\nxmlshow is a super-simple XML viewer for the Unix command line, which should provide most everything you could wish,\nsince uses the features of [less](https://ss64.com/bash/less.html).\n\n  - It will display any **large** XML file in a breeze.\n  - It has syntax highlighting\n  - If it is a zip file, it will unzip it in the process (zipping is *both* indispensable and effective, \n    since XML is wonderfully redundant).\n  - It has line numbering\n  - You can navigate forward and backward\n  - You can use sed search patterns.\n\n### Limitations\nThere are two things, however, that it won't do:\n  - Modifying the file\n  - Prepare or serve coffee\n\n### Usage\nJust type:\n\n    $ xmlshow \u003cfilename\u003e\n    \n\u003cimg src=\"Demo.gif\" /\u003e\n\nIt will also read from stdin if no argument is provided. Hence if some utility outputs some well-form XML on stdout, you can pipe it into xml show:\n\n    $ some-utility | xmlshow\n\n## How it works\nIt combines:\n\n  - unzip, to extract the file\n  - file to check the mime type of the input file\n  - [xmllint](http://xmlsoft.org/xmllint.html), for beautifying the XML.\n  - highlight to highlight the syntax\n  - [less](https://ss64.com/bash/less.html) to view the file and add the line numbers.\n  \n The script does it for you, but this is the substance:\n \n     xmllint --format \u003cyourfile\u003e | highlight --syntax=xml --out-format=xterm-256 | less -R -N\n     \n (the `-R` parameter in `less` is for raw (i.e. to preserve the escape codes for colors), and `-N` is for numbering)\n    \nThat's all there is to it: it's just a typical shell hack with Unix pipes, sufficiently long to warrant a script file, and sufficiently useful to be put on github.\n\n## How to install it\n\n  1. Download the .sh file an install it some directory in your path (type `echo $PATH`to find out).\n  2. Make it executable: `chmod +x xmlshow.sh`\n  2. In that same directory, create a soft link: `ln -s xmlshow.sh xmlshow`\n  3. If it fails, make sure that utilities mentioned above (typically xmllint and highlight) are installed on your system. If not use your favorite package manager\n     - On Debian, `apt get install`\n     - On MacOs, `brew install` is your friend (see [instructions to install brew](https://brew.sh/))\n\n*Voilà*, you should be all set.\n \n## Tips\n\n### Navigating the file\nThe [less](https://ss64.com/bash/less.html) utility has actually quite a few tricks up its sleeves.\n\nBeside the usual commands, remember that:\n\n - `z`jumps one window forward\n - `w`jumps one window backward\n - **`h` calls a help, with plenty of good features you may not have suspected (use q to quit)**\n - To search for a pattern just type `/pattern`\n\n### Viewing more text\nIt is also worth remembering that it is often easy to display more text at once, either by getting a smaller font on your terminal pane (on MacOS: `CMD -`, `CMD 0` to get to normal), or by increasing the size of the window or pane!\n\n### Consulting the XML content of a docx document\nSince you can use xmlshow in a pipe, you can do something like this:\n\n    unzip -p myfile.docx word/document.xml | xmlshow\n    \nIt tells unzip to decompress the document.xml file and to send it to stdout, ready to be piped into xmlshow.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffralau%2Fxmlshow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffralau%2Fxmlshow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffralau%2Fxmlshow/lists"}