This project is a Java library to ease up the handling of XML files.
- Supports Java 17 or higher
- XML mixed content not supported
Add following dependency to your project. Replace the value of the attribute version
according to the used
version in your project.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
...
<dependencies>
<dependency>
<groupId>de.elomagic</groupId>
<artifactId>xmltools</artifactId>
<version>[1,]</version>
</dependency>
</dependencies>
...
</project>
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<String, String> map = converter.convert(Paths.get("document.xml"));
}
}
import de.elomagic.xmltools.KeyValue2XmlConverter;
import org.w3c.dom.Document;
import java.util.Map;
class Sample {
void example() throws Exception {
Map<String, String> map = Map.of(
"de.elomagic.a", "1234",
"de.elomagic.b", "5678"
);
KeyValue2XmlConverter converter = new KeyValue2XmlConverter();
Document document = converter.convert(map);
}
}
What you need is an installed JDK at least version 17 and Apache Maven.
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.
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Versioning follows the semantic of Semantic Versioning 2.0.0
Execute following steps:
- Are the CHANGELOG.md up to date?
- Check the version in the
pom.xml
and CHANGELOG.md - Set release date in the CHANGELOG.md
- Execute GitHub action "release"
The xmltools is distributed under Apache License, Version 2.0