
name.remal.org.jdom2.Document.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common Show documentation
Show all versions of common Show documentation
Java & Kotlin tools: common
The newest version!
package name.remal
import org.jdom2.Document
import org.jdom2.Element
fun Document.clearNamespaces() = apply {
descendants.forEach { node ->
if (node is Element) {
if (node.hasAttributes()) {
node.attributes.forEach { it.namespace = null }
}
node.namespace = null
if (node.hasAdditionalNamespaces()) {
node.additionalNamespaces.toList().forEach(node::removeNamespaceDeclaration)
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy