Skip to content
Commits on Source (6)
......@@ -34,7 +34,7 @@ To use Jackson 2.x compatible version of this extension on Maven-based projects,
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.9.0</version>
<version>2.9.6</version>
</dependency>
```
......@@ -53,6 +53,8 @@ You can do this by adding this in your `pom.xml`:
# Usage
## Constructing Mapper
Although module implements low-level (`JsonFactory` / `JsonParser` / `JsonGenerator`) abstractions,
most usage is through data-binding level. This because a small number of work-arounds have been added
at data-binding level, to work around XML peculiarities: that is, stream of `JsonToken`s that parser
......@@ -77,6 +79,24 @@ XmlMapper xmlMapper = new XmlMapper(module);
as many features that `XmlMapper` needs are provided by `JacksonXmlModule`; default
`XmlMapper` simply constructs module with default settings.
Alternatively, sometimes you may want/need to configure low-level XML processing details
controlled by underlying Stax library (Woodstox, Aalto or JDK-default Oracle implementation).
If so, you will need to construct `XmlMapper` with properly configured underlying factories.
This usually looks something like:
```java
XMLInputFactory ifactory = new WstxInputFactory(); // Woodstox XMLInputFactory impl
ifactory.setProperty(WstxInputProperties.P_MAX_ATTRIBUTE_SIZE, 32000);
// configure
XMLOutputFactory ofactory = new WstxOutputFactory(); // Woodstox XMLOutputfactory impl
ofactory.setProperty(WstxOutputProperties.P_OUTPUT_CDATA_AS_TEXT, true);
XmlFactory xf = new XmlFactory(ifactory, ofactory);
XmlMapper mapper = new XmlMapper(xf); // there are other overloads too
```
For configurable properties, you may want to check out
[Configuring Woodstox XML parser](https://medium.com/@cowtowncoder/configuring-woodstox-xml-parser-woodstox-specific-properties-1ce5030a5173)
## Android quirks
While usage on Android is the same as on standard JDKs, there is one thing that may cause issues:
......@@ -213,7 +233,14 @@ Currently, following limitations exist beyond basic Jackson (JSON) limitations:
* `JacksonXmlModule.setDefaultUseWrapper()` can be used to specify whether "wrapped" or "unwrapped" setting is the default
* Tree Model is only supported in limited fashion: specifically, Java arrays and `Collection`s can be written, but can not be read, since it is not possible to distinguish Arrays and Objects without additional information.
# See Also
# Documentation
* XML module [wiki page](https://github.com/FasterXML/jackson-dataformat-xml/wiki) for more information
* Various Blog posts on Woodstox:
* [Standard Stax 1.x config properties](https://medium.com/@cowtowncoder/configuring-woodstox-xml-parser-basic-stax-properties-39bdf88c18ec)
* [Stax2 extension config properties](https://medium.com/@cowtowncoder/configuring-woodstox-xml-parser-stax2-properties-c80ef5a32ef1)
* [Woodstox-specific config properties](https://medium.com/@cowtowncoder/configuring-woodstox-xml-parser-woodstox-specific-properties-1ce5030a5173)
# See Also
* Using XML with [DropWizard](https://github.com/dropwizard/dropwizard)? Check out [this extension](https://github.com/yunspace/dropwizard-xml)!
jackson-dataformat-xml (2.9.7-1) unstable; urgency=medium
* New upstream version 2.9.7.
* Declare compliance with Debian Policy 4.2.1.
-- Markus Koschany <apo@debian.org> Tue, 02 Oct 2018 18:52:55 +0200
jackson-dataformat-xml (2.9.6-1) unstable; urgency=medium
* New upstream version 2.9.6.
......
......@@ -25,7 +25,7 @@ Build-Depends:
libstax2-api-java (>= 3.1.1),
maven-debian-helper (>= 1.5),
xmlstarlet
Standards-Version: 4.2.0
Standards-Version: 4.2.1
Vcs-Git: https://anonscm.debian.org/git/pkg-java/jackson-dataformat-xml.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/jackson-dataformat-xml.git
Homepage: http://wiki.fasterxml.com/JacksonExtensionXmlDataBinding
......
From: Markus Koschany <apo@debian.org>
Date: Fri, 17 Aug 2018 21:31:33 +0200
Subject: jackson-base version
Date: Tue, 2 Oct 2018 18:54:25 +0200
Subject: jackson-base-version
Use the debian version.
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index c7ee5c5..902d87c 100644
index 605c61e..7e8de1d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-base</artifactId>
- <version>2.9.6</version>
- <version>2.9.7</version>
+ <version>debian</version>
</parent>
<groupId>com.fasterxml.jackson.dataformat</groupId>
......
......@@ -10,7 +10,7 @@ Bug-Debian: https://bugs.debian.org/906368
1 file changed, 14 insertions(+)
diff --git a/pom.xml b/pom.xml
index 902d87c..fca8726 100644
index 181a0ae..605c61e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -116,6 +116,20 @@ Some data-binding types overridden as well (ObjectMapper sub-classed as XmlMappe
......
jackson-base-version.patch
javadoc-classpath.patch
jackson-base-version.patch
......@@ -4,11 +4,11 @@
<parent>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-base</artifactId>
<version>2.9.6</version>
<version>2.9.7</version>
</parent>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.9.6</version>
<version>2.9.7</version>
<name>Jackson-dataformat-XML</name>
<packaging>bundle</packaging>
<description>Data format extension for Jackson (http://jackson.codehaus.org) to offer
......@@ -21,7 +21,7 @@ Some data-binding types overridden as well (ObjectMapper sub-classed as XmlMappe
<connection>scm:git:git@github.com:FasterXML/jackson-dataformat-xml.git</connection>
<developerConnection>scm:git:git@github.com:FasterXML/jackson-dataformat-xml.git</developerConnection>
<url>http://github.com/FasterXML/jackson-dataformat-xml</url>
<tag>jackson-dataformat-xml-2.9.6</tag>
<tag>jackson-dataformat-xml-2.9.7</tag>
</scm>
<properties>
<packageVersion.dir>com/fasterxml/jackson/dataformat/xml</packageVersion.dir>
......
......@@ -4,7 +4,16 @@ Project: jackson-dataformat-xml
= Releases
------------------------------------------------------------------------
2.9.7 (19-Sep-2018)
No changes since 2.9.6
2.9.6 (12-Jun-2018)
#282: `@JacksonXmlRootElement` malfunction when using it with multiple `XmlMapper`s
and disabling annotations
(reported by benej60@github)
2.9.5 (26-Mar-2018)
No changes since 2.9.4
......