-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding addElements, addElementsAfter, addElementsBefore, replac… (
#60) * feat: adding addElements, addElementsAfter, addElementsBefore, replaceElement, and replaceElement. adding ktlint * chore: bumping version to 1.9.1 and adding release notes
- Loading branch information
Showing
52 changed files
with
719 additions
and
337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[*.{kt,kts}] | ||
indent_style = tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
kotlin-xml-builder/src/main/kotlin/org/redundent/kotlin/xml/Attribute.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package org.redundent.kotlin.xml | ||
|
||
data class Attribute @JvmOverloads constructor( | ||
val name: String, | ||
val value: Any, | ||
val namespace: Namespace? = null) | ||
val name: String, | ||
val value: Any, | ||
val namespace: Namespace? = null | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 20 additions & 19 deletions
39
kotlin-xml-builder/src/main/kotlin/org/redundent/kotlin/xml/Doctype.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
package org.redundent.kotlin.xml | ||
|
||
class Doctype @JvmOverloads constructor( | ||
private val name: String, | ||
private val systemId: String? = null, | ||
private val publicId: String? = null) : Element { | ||
private val name: String, | ||
private val systemId: String? = null, | ||
private val publicId: String? = null | ||
) : Element { | ||
|
||
override fun render(builder: Appendable, indent: String, printOptions: PrintOptions) { | ||
builder.append("<!DOCTYPE $name") | ||
override fun render(builder: Appendable, indent: String, printOptions: PrintOptions) { | ||
builder.append("<!DOCTYPE $name") | ||
|
||
val publicIdSet = publicId != null | ||
val systemIdSet = systemId != null | ||
val publicIdSet = publicId != null | ||
val systemIdSet = systemId != null | ||
|
||
if (publicIdSet) { | ||
builder.append(" PUBLIC \"$publicId\"") | ||
} | ||
if (publicIdSet) { | ||
builder.append(" PUBLIC \"$publicId\"") | ||
} | ||
|
||
if (systemIdSet) { | ||
if (!publicIdSet) { | ||
builder.append(" SYSTEM") | ||
} | ||
builder.append(" \"$systemId\"") | ||
} | ||
if (systemIdSet) { | ||
if (!publicIdSet) { | ||
builder.append(" SYSTEM") | ||
} | ||
builder.append(" \"$systemId\"") | ||
} | ||
|
||
builder.appendLine(">") | ||
} | ||
} | ||
builder.appendLine(">") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.