Skip to content

Commit 83c5c72

Browse files
committed
Fix #326
1 parent 26087df commit 83c5c72

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

release-notes/VERSION-2.x

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Project: jackson-dataformat-xml
88

99
#242: Deserialization of class inheritance depends on attributes order
1010
(reported by Victor K)
11+
#326: Force namespace-repairing on `XMLOutputFactory` instances
1112
#354: Support mapping `xsi:nul` marked elements as `null`s (`JsonToken.VALUE_NULL`)
1213

1314
2.10.0.pr2 (31-Aug-2019)

src/main/java/com/fasterxml/jackson/dataformat/xml/XmlFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public XmlFactoryBuilder rebuild() {
164164

165165
protected void _initFactories(XMLInputFactory xmlIn, XMLOutputFactory xmlOut)
166166
{
167-
// Better ensure namespaces get built properly, so:
167+
// [dataformat-xml#326]: Better ensure namespaces get built properly, so:
168168
xmlOut.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
169169
// and for parser, force coalescing as well (much simpler to use)
170170
xmlIn.setProperty(XMLInputFactory.IS_COALESCING, Boolean.TRUE);

src/main/java/com/fasterxml/jackson/dataformat/xml/XmlFactoryBuilder.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,12 @@ public XMLOutputFactory xmlOutputFactory() {
107107
}
108108

109109
protected static XMLOutputFactory defaultOutputFactory() {
110-
return XMLOutputFactory.newInstance();
110+
XMLOutputFactory xmlOut = XMLOutputFactory.newInstance();
111+
// [dataformat-xml#326]: Better ensure namespaces get built properly:
112+
xmlOut.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
113+
return xmlOut;
111114
}
112-
115+
113116
// // // Parser features
114117

115118
public XmlFactoryBuilder enable(FromXmlParser.Feature f) {

0 commit comments

Comments
 (0)