redundent / kotlin-xml-builder

A lightweight type safe builder to build xml documents in Kotlin
Apache License 2.0
155 stars 19 forks source link

prolog hardcoded to 1.0, text is escaped to 1.1 #22

Closed ZR8C closed 5 years ago

ZR8C commented 5 years ago

Text is encoded to the 1.1 schema of xml here: https://github.com/redundent/kotlin-xml-builder/blob/fae1b2007b68df1e27f2b0f60b7273ab41fa1eed/kotlin-xml-builder/src/main/kotlin/org/redundent/kotlin/xml/TextElement.kt#L20

But the prolog string is hardcoded to 1.0: https://github.com/redundent/kotlin-xml-builder/blob/fae1b2007b68df1e27f2b0f60b7273ab41fa1eed/kotlin-xml-builder/src/main/kotlin/org/redundent/kotlin/xml/Node.kt#L167

Ideally default to one or the other, and allow it to be specified.

redundent commented 5 years ago

Hi @ZR8C , Thanks for reporting this. I just published version 1.5.2 that has this fixed. You can now specify the version and the text escaping respects it.