mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
* Add Ballerina language * Add missing file * Update color * Update with required changes * Update sub-module
27 lines
670 B
Ballerina
27 lines
670 B
Ballerina
import ballerina.lang.system;
|
|
|
|
function main (string[] args) {
|
|
|
|
// XML element. Can only have one root element.
|
|
xml x1 = xml `<book>The Lost World</book>`;
|
|
system:println(x1);
|
|
|
|
// XML text
|
|
xml x2 = xml `Hello, world!`;
|
|
system:println(x2);
|
|
|
|
// XML comment
|
|
xml x3 = xml `<!--I am a comment-->`;
|
|
system:println(x3);
|
|
|
|
// XML processing instruction
|
|
xml x4 = xml `<?target data?>`;
|
|
system:println(x4);
|
|
|
|
// Multiple XML items can be combined to form a sequence of XML. The resulting sequence is again an XML on its own.
|
|
xml x5 = x1 + x2 + x3 + x4;
|
|
system:println("\nResulting XML sequence:");
|
|
system:println(x5);
|
|
|
|
}
|