https://github.com/elomagic/xmltools
XML Tools
https://github.com/elomagic/xmltools
converters key-value mapper xml
Last synced: about 2 months ago
JSON representation
XML Tools
- Host: GitHub
- URL: https://github.com/elomagic/xmltools
- Owner: elomagic
- License: apache-2.0
- Created: 2023-07-23T06:38:58.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-09T14:45:42.000Z (about 2 months ago)
- Last Synced: 2025-04-09T15:45:20.047Z (about 2 months ago)
- Topics: converters, key-value, mapper, xml
- Language: Java
- Homepage: https://github.com/elomagic/xmltools
- Size: 188 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.MD
- License: LICENSE.txt
Awesome Lists containing this project
README
# xmltools - Tooling for managing XML
---
[][license]
[](https://mvnrepository.com/artifact/de.elomagic/xmltools)
[](https://github.com/elomagic/xmltools/actions)
[](https://github.com/elomagic/xmltools/issues)
[](https://GitHub.com/elomagic/xmltools/tags/)
[](https://github.com/elomagic/xmltools/graphs/commit-activity)
[](https://www.buymeacoffee.com/elomagic)## What is this xmltools ? ###
This project is a Java library to ease up the handling of XML files.
* Supports Java 17 or higher
### Current limitations
* XML mixed content not supported
## Using the library
### Maven
Add following dependency to your project. Replace the value of the attribute ```version``` according to the used
version in your project.```xml
...
de.elomagic
xmltools
[1,]
...
```
## Using the API
### Convert XML to key values
```java
import de.elomagic.xmltools.Xml2KeyValueConverter;import org.w3c.dom.Document;
import java.nio.file.Paths;
class Sample {
void example() throws Exception {
Xml2KeyValueConverter converter = new Xml2KeyValueConverter();
Map map = converter.convert(Paths.get("document.xml"));
}}
```### Convert key values to XML
```java
import de.elomagic.xmltools.KeyValue2XmlConverter;
import org.w3c.dom.Document;
import java.util.Map;class Sample {
void example() throws Exception {
Map map = Map.of(
"de.elomagic.a", "1234",
"de.elomagic.b", "5678"
);KeyValue2XmlConverter converter = new KeyValue2XmlConverter();
Document document = converter.convert(map);
}}
```## How to build artefact by myself?
What you need is an installed JDK at least version 17 and [Apache Maven](https://maven.apache.org).
Then clone this project to your local file system and execute `mvn clean install` in the project folder. After successful finish you find
the artefact in the `target` folder.Note, latest SNAPSHOTs can also be found under "releases" in the GitHub project page.
## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
### Versioning
Versioning follows the semantic of [Semantic Versioning 2.0.0](https://semver.org/)
### Releasing new version / hotfix (Only for users who have repository permissions)
#### Releasing new version / hotfix
Execute following steps:
* Are the [CHANGELOG.md](https://github.com/elomagic/xmltools/blob/main/CHANGELOG.md) up to date?
* Check the version in the ```pom.xml``` and [CHANGELOG.md](https://github.com/elomagic/xmltools/blob/main/CHANGELOG.md)
* Set release date in the [CHANGELOG.md](https://github.com/elomagic/xmltools/blob/main/CHANGELOG.md)
* Execute GitHub action "release"## License
The xmltools is distributed under [Apache License, Version 2.0][license]
[license]: https://www.apache.org/licenses/LICENSE-2.0