Re: hello world
Martin Klang <[email protected]> Sat, 13 Nov 2004 12:57:05 +0000
| Newsgroups | gmane.text.xml.o-xml |
|---|---|
| Message-ID | <[email protected]> |
Hi Alex!
Thanks for the mail. We used to have a bunch of examples online but
they all seemed a bit out of date, so I took them off. I'd like to
start collecting some good, short examples illustrative of what can be
done with o:XML, so all contributions are welcome. When I find the time
I'll put up a dedicated page on the website.
What other examples have you come across that don't work? The ones in
the XML.com article are all missing the namespace declarations, which
is probably quite silly.
> My example simply
> prints the entire oml file to stdout (is that correct?):
not quite as intended maybe -
> <o:program xmlns:o="http://www.o-xml.org/lang">
the namespace URI should have a slash:
<o:program xmlns:o="http://www.o-xml.org/lang/">
that's the 'magic' o:XML namespace - all other XML is simply
interpreted as literal XML instructions and copied to the output.
running it then produces
$ java -jar objectbox.jar hello.oml
<?xml version="1.0"?>
Hello World
I'm hesitant to put up only a hello world example though, since it
might be confusing eg "is that how much code is required for hello
world?!"
A shorter hello world would be:
<?xml version="1.0"?>
<o:do xmlns:o="http://www.o-xml.org/lang/">Hello World</o:do>
but then that's not a very informative example!
best regards,
/m
ps Someone else reported problems with the mailing list. Not sure what
is wrong, I'll investigate..