![Latest Version](https://img.shields.io/maven-central/v/com.codeaddslife.koara/koara-xml.svg?label=Maven Central)
Koara-java-xml
Koara is a modular lightweight markup language. This project can render the koara AST to Xml in Java.
The AST is created by the core koara parser.
Getting started
Usage
package demo;
import com.codeaddslife.koara.Parser;
import com.codeaddslife.koara.ast.Document;
import XmlRenderer;
public class App {
public static void main(String[] args) {
Parser parser = new Parser();
Document result = parser.parse("Hello World!");
XmlRenderer renderer = new XmlRenderer();
result.accept(renderer);
System.out.println(renderer.getOutput());
}
}
Configuration
You can configure the Renderer:
-
parser.setHardWrap(boolean hardWrap)
Default: false
Specify if newlines should be hard-wrapped (return-based linebreaks) by default.
-
renderer.setDeclarationTag(String declarationTag)
Default: null
Add an XML Declaration Tag add the top of the generated output.