Skip to content

Commit 136e5d3

Browse files
committed
fix sample
1 parent cdf0eff commit 136e5d3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ Serialization is done very similar to JSON serialization: all that needs to chan
8989
```java
9090
// Important: create XmlMapper; it will use proper factories, workarounds
9191
ObjectMapper xmlMapper = new XmlMapper();
92-
String xml = xmlMapper.writeValue(new Simple());
92+
String xml = xmlMapper.writeValueAsString(new Simple());
93+
// or
94+
xmlMapper.writeValue(new File("/tmp/stuff.json"), new Simple());
9395
```
9496

9597
and with POJO like:

0 commit comments

Comments
 (0)