https://github.com/daniel-sc/xmlcleaner
Cleans XML files (in place), by removing all elements (and their children), that have a specific attribute with a value matching the given pattern.
https://github.com/daniel-sc/xmlcleaner
cleanup command-line-tool dita xml
Last synced: 8 months ago
JSON representation
Cleans XML files (in place), by removing all elements (and their children), that have a specific attribute with a value matching the given pattern.
- Host: GitHub
- URL: https://github.com/daniel-sc/xmlcleaner
- Owner: daniel-sc
- License: mit
- Created: 2017-02-03T10:38:13.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-06T16:33:53.000Z (over 9 years ago)
- Last Synced: 2025-10-08T06:45:10.532Z (8 months ago)
- Topics: cleanup, command-line-tool, dita, xml
- Language: Java
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# XmlCleaner
Cleans XML files (in place), by removing all elements (and their children), that have a specific attribute with a value matching the given pattern.
Formatting of the files is kept/unchanged.
## Build
mvn clean install
## Usage
Usage: java -jar xmlcleaner-*-jar-with-dependencies.jar [options] files/directories
Options:
--attribute, -a
XML attribute name.
Default: rev
--attribute-only, -ao
Remove only matched attribute (instead of complete node/element).
Default: false
--help
Display usage.
--matcher, -m
Attribute value matcher (regex).
Default: 1[45]\.\d+(?:\.\d+)?d.*
## Known issues
1. Might remove last `
- `. Results in invalid XML.
2. Might remove child objects, where the parent element is not valid (w.r.t XML schema) without this child. This is the generalization of #1.