Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/julian-eggers/spring-xom-marshaller

Spring XML Marshalling with XOM
https://github.com/julian-eggers/spring-xom-marshaller

java spring spring-boot xml xom xpath

Last synced: 20 days ago
JSON representation

Spring XML Marshalling with XOM

Awesome Lists containing this project

README

        

# spring-xom-marshaller

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.itelg.spring/spring-xom-marshaller/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.itelg.spring/spring-xom-marshaller)
[![Build](https://github.com/julian-eggers/spring-xom-marshaller/workflows/release/badge.svg)](https://github.com/julian-eggers/spring-xom-marshaller/actions)
[![Nightly build](https://github.com/julian-eggers/spring-xom-marshaller/workflows/nightly/badge.svg)](https://github.com/julian-eggers/spring-xom-marshaller/actions)

Spring XML Marshalling with [XOM](http://www.xom.nu/)

#### Maven
```xml

com.itelg.spring
spring-xom-marshaller
1.3.0

```

#### Examples

##### Enable auto-configuration via annotation

[@Autowire](http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/beans/factory/annotation/Autowire.html) XomMarshaller for further use in [MarshallingHttpMessageConverter](http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/http/converter/xml/MarshallingHttpMessageConverter.html) or [MarshallingMessageConverter](http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/messaging/converter/MarshallingMessageConverter.html).

```java
@SpringBootApplication
@EnableXomMarshaller
public class Application
{
@Autowired
private XomMarshaller xomMarshaller;

public static void main(String[] args) throws Exception
{
SpringApplication.run(Application.class, args);
}
}
```

##### Example-Writer
```java
@Component
public class IntegerWriter extends AbstractWriter
{
@Override
protected Element doWrite(Integer integer)
{
Element rootElement = new Element("integer");
Element valueElement = new Element("value");
valueElement.appendChild(integer.toString());
rootElement.appendChild(valueElement);

return rootElement;
}
}
```

## Build & Release

### Build
```
mvn clean package
```

### Release
```
mvn clean deploy
```