All entries for July 2006
July 17, 2006
It's so nice to have the summer vacation to do what ever I please. However it comes at a price: having to choose!
I'm currently involved in a few open source projects (BindingListView , Specter and BooML )
I also have to eat… so I'm working on some commerical software too.
I really should try to get out and see friends too! Damn, 3 months may not be enough for it all.
Hopefully I'll find time to keep blogging too… :)
The source for BooML is now online. The project is hosted by SourceForge. link
So far I've just got the source into SubVersion. I'm so busy at the moment (too many pies, not enough fingers!) – but I really must get some docs online too.
July 01, 2006
Creating XML using the .NET XmlWriter object model tends to make your code look awful. I realised that using some mackery I could make Boo support creating XML right in the language. Thus was born "BooML"
Here is a little example.
The resulting XML is:
private _title as string
private _author as string
Book(Title: "Foo Bar", Author: "Bob Smith"),
Book(Title: "Test Title", Author: "Andrew Davey")
for book as Book in books:
@id = book.GetHashCode()
xml = GetBooksXml(GetBooks())
<?xml version="1.0" encoding="utf-8"?>
The magic is in the XmlLiteral AST Attribute. It transforms macros (in the example: books, book, @id, title and author) into XML macros. The XML macros then in turn create the XmlTextWriter calls.
I think this could be a really powerful language enhancement for people doing web development who want to return abitrary XML from methods.
I may start a SourceForge project to open source the development.