The classic hello world program does not really exercise many of the features which make XmlPL special. It is an XML processor after all. So here is hello world, web page.
node[] main() {
<http>
<head>
</head>
<body>
</body>
</http>
}
First create a blank Web page by outputting some XML data from main. Remember that the node[] return type indicates that main will output a stream of XML nodes.
node[] main() {
string helloString = "Hello World!";
<http>
<head>
</head>
<body>
</body>
</http>
}
This step creates a variable, helloString and initializes it to the value "Hello World!".
node[] main() {
string helloString = "Hello World!";
<http>
<head>
<title>helloString;</title>
</head>
<body>
<h1>helloString;</h1>
</body>
</http>
}
Output both page title and first header. Hello world, Web page is complete.
The following shell script will compile and execute the program.