Compiler error when confiure XmlMapper

46 views
Skip to first unread message

Marko

unread,
Jan 3, 2024, 2:37:07 PMJan 3
to jackson-user
Hi

I got. a Kotlin compiler error when I try to enable the XML processing information. I'm using the latest version 2.16.1.

Code:

fun generateReport(reportModel: Model): String {
val xmlMapper = XmlMapper().registerModule(KotlinModule.Builder().build()).apply {
// Next line I got the error. The compiler can't find an appropriate implementation. Also enable, does not work.
factory.configure(ToXmlGenerator.Feature.WRITE_XML_1_1, true)
}
return xmlMapper.writeValueAsString(reportModel)
}
Reply all
Reply to author
Forward
0 new messages