Skip to content

umjammer/vavi-apps-xed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Release Java CI CodeQL Java

XED

a command line Xml EDitor.

Goal

  • sort by tag
  • edit inner text specified by tag

Example

  • a KML exported from the FourSquare
  • 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
$ 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