Transform XML with XSL, and string

This took us a while to find and put together. I don’t want to have to go through it again.

This function takes a xml-string and transforms it with the sent-in xsl (also string). The output is returned as a memory stream that, for example, can be set in a webbrowser controls DocumentStream property.

Here is the code (yes, in my favorite new language VB.NET ;)):

Friend Shared Function TransformXML(ByVal xmlString As String, ByVal xslString As String) As MemoryStream Dim memStream As MemoryStream = Nothing Try ' Create a xml document from the sent-in string Dim xmlDoc As New XmlDocument xmlDoc.LoadXml(xmlString) ' Load the xsl as a xmldocument, from the sent-in string Dim xslDoc As New XmlDocument xslDoc.LoadXml(xslString)' Create and load an transformation Dim trans As New XslCompiledTransform trans.Load(xslDoc) ' Create a memorystrem to hold the response memStream = New MemoryStream() Dim srWriter As New StreamWriter(memStream) ' Transform...

Read More

VB.NET - warnings for XML documentation, denied

When you generate system documentation from the XML comments in your code you want a way to be sure that the quality of the comments are as good as they can be, and in the earliest stage possible.

One way to accomplish this would have the compiler to issue an warning for all missing, faulty or un-matched comments it finds during compilation. In Visual Studio 2005 and C# this is very easy by setting the warning level to 4, treat all warning as errors and generating XML documentation.

VB.NET however… is another story all together, and again i understand that this is a choice. It’s like a philosophy of the language; VB.NET stands for simplicity and getting help from the environment where C# stands for control and managing the nitty-gritty details. However AI or help from the environment in my opinion very often leads to situations where you want to...

Read More

Paris in pictures

Here are some pictures from Paris, where Elin and I went this weekend. Not as warm as in Sweden but perfect sightseeing-weather. We must have walked 2 miles (Swedish that is) each day…

Read More

VB.NET showing build configuration

Just found a solution to something that have confused and annoyed for a while.

In VB.NET the current configuration (Debug/Release) is not shown. This is quite confusing if you are setting properties on a project, for instance. Which configuration are you setting the property for?

Here is the solution; it turns out that VB.NET is hiding the configuration for you by default. So to show them again go: Tools->Options->Projects and Solutions->Show advanced build configurations

Read More

Whit friday and Black Dyke

There is a famous brass band / marching competition in Great Britain called Whit Friday. There are loads and loads of bands taking part and they march up to a small village do a march and then continue on. Most bands do more than 15 events like this during the day.

There really fun part of it is that bands of all sorts take part from the most famous to the …eh.. not so famous.

Here is a short clip of Black Dyke doing a march in Delph. Take special notice of the tuba players in the front. I could carry one of those tubas for a minute, not to mention how it would be to play it…

Read More

The french

The french people, by the way, is really interesting… They still think that English is not to vital to know, even the people involved in tourism.

And just to show how little the are willing to adapt to standards that the rest of the western world adhere to… the French keyboard:

Yep - you’ve guessed it folks. The French have a keyboard of their own. Of course i might add…

Read More


I’ve been away on a short trip to Paris for a few days. It was my surprise-birthday-present to Elin. She was really surprised also - i went to her workplace and played (of course) “our song” on my euphonium. I guess that it wasn’t too good since two people guessed that it was the fire alarm. This is, by far, the worst criticism i ever have gotten :).

Then we went to Paris and saw all the great things there; Sacre Couer, Eiffel Tower (yes - we went up. No - walked the first two levels, then elevator), L’arc Triumpic and Paris town in general. It really is a nice town. I’ve been there before and didn’t like it too much but now it was great.

The hotel we stayed in was not to great (Altona - don’t go there) and was run by two brothers that each...

Read More

VasaGospel release

Today i will introduce a great choir when they release a new CD. They are VasaGospel and i am so proud to have a choir like that in the ranks of our corps (church for all you non-salvationists).

I have been a secret fan of them and have listen to some of their earlier CD’s and they really rock! If you ever get the opportunity to hear them - don’t miss it! Great singing, great band and some great testimonies.

So - tonight they release their latest CD “In need”. Observatoriegatan 4, Stockholm. Don’t miss it.

Also, another first for me - introducing a CD-release

Read More

TeamSystem, MSBuild and ClickOnce

I’ve finally got around to work a bit more with our buildscript, which we are running on top of Team System. I’ve once coded a build script based on other products (, NUnit etc.) so i hoped and thought that this wouldn’t differ to much. However sometimes your hopes gets fulfilled and sometimes… well, you’ll see.

Firstly building buildscripts for Team Systems are more like responding to events that gets fired by the Team System build engine, than writing the flow yourself. Which events get fired and which order they fire in can be found here.

Also - the start of building buildscripts with Team System is a wizard, which is nice but all that it’s really doing is generating the stub for the MSBuild-script-file for you. If you want to tweak it (and you want) you’ll have to code in the “scary” MSBuild/XML-langauge.

And finally the Team System...

Read More


This is really fun and maybe useful also:

What the site does is that it allows you to sing or hum a part of a song and then it finds the song for you. But wait, there is more; when you find the song you can also hear how others has … interpret the song.

This will be so fun in a few months when there are loads and loads of songs.

Read More