Closed keltik85 closed 4 years ago
There isn't any special support for multiple namespaces but you can achieve it by just adding the namespaces as attributes on the element.
val person = xml("ns1:Person") {
attribute("xmlns:ns1", "foo:bar:baz:one")
attribute("xmlns:ns2", "foo:bar:baz:two")
attribute("xmlns:ns3", "foo:bar:baz:three")
"ns1:name"("John")
"ns2:info" {
"ns3:age"("123")
}
}
That should work for now. I can add specific support for multiple namespaces
@keltik85 I don't know how I forgot about this but the library already supports multiple namespaces.
val person = xml("ns1:Person") {
namespace("ns1", "foo:bar:baz:one")
....
}
Hi, thanks for your explanation @redundent .
How to add the dependency using maven?
I haven't used maven in a very long time but if memory serves me, the following should work.
You might need to add the jcenter repo if you don't already have it
<repositories>
<repository>
<id>jcenter</id>
<url>https://jcenter.bintray.com/</url>
</repository>
</repositories>
Then just add the dependency as normal
<dependency>
<groupId>org.redundent</groupId>
<artifactId>kotlin-xml-builder</artifactId>
<version>1.5.2</version>
</dependency>
Can this library produce this kind of xml with mutliple namespaces nested within each other?