From 136e5d3a5bb758137001d79fa5f381dceb8a5128 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Mon, 13 Jan 2014 20:39:01 -0800 Subject: [PATCH] fix sample --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b86ac60f..22786a79c 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,9 @@ Serialization is done very similar to JSON serialization: all that needs to chan ```java // Important: create XmlMapper; it will use proper factories, workarounds ObjectMapper xmlMapper = new XmlMapper(); -String xml = xmlMapper.writeValue(new Simple()); +String xml = xmlMapper.writeValueAsString(new Simple()); +// or +xmlMapper.writeValue(new File("/tmp/stuff.json"), new Simple()); ``` and with POJO like: