https://github.com/umjammer/vavi-apps-xed
⚒ Command Line XML Editor
https://github.com/umjammer/vavi-apps-xed
cli java xml xml-editor
Last synced: about 2 months ago
JSON representation
⚒ Command Line XML Editor
- Host: GitHub
- URL: https://github.com/umjammer/vavi-apps-xed
- Owner: umjammer
- Created: 2013-06-28T07:24:22.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2024-06-05T09:27:49.000Z (about 2 years ago)
- Last Synced: 2024-06-05T10:45:56.683Z (about 2 years ago)
- Topics: cli, java, xml, xml-editor
- Language: Java
- Homepage:
- Size: 41 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://jitpack.io/#umjammer/vavi-apps-xed)
[](https://github.com/umjammer/vavi-apps-xed/actions/workflows/maven.yml)
[](https://github.com/umjammer/vavi-apps-xed/actions/workflows/codeql-analysis.yml)

# XED
a command line **X**ml **ED**itor.
## Goal
* sort by tag
* edit inner text specified by tag
## Example
* a KML exported from the [FourSquare](https://ja.foursquare.com/feeds/)
* sort by updated time ascending (`-s` option)
* add updated time to description tag (`-e` option)
* `'$$'` inside a string is replaced by the original inner text
* function `xpath_sdf(xpath, format1, format2)` reformats date/time text using `java.util.SimpleDateFormat`
```shell
$ java -cp foo xed \
-s "/kml/Folder/Placemark" "/kml/Folder/Placemark/updated/text()" asc datetime "EEE, d MMM yy HH:mm:ss Z" \
-e "/kml/Folder/Placemark" "/kml/Folder/Placemark/description" "xpath_sdf('/kml/Folder/Placemark/updated/text()', 'EEE, d MMM yy HH:mm:ss Z', 'yyyy/MM/dd HH:mm:ss') + ' | $$'" \
in_file.kml
```
```
$ xmllint --format foo.kml > bar.kml
```
## TODO
* splitter (wip?)
* ~~bump all version of a dependency in my projects pom.xml~~